package org.jeecg.modules.online.cgform.service.impl;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;

import org.apache.commons.lang.StringUtils;
import org.hibernate.HibernateException;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.enums.CgformEnum;
import org.jeecg.common.exception.TuringBootBizTipException;
import org.jeecg.common.exception.TuringBootException;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.util.CommonUtils;
import org.jeecg.common.util.MyClassLoader;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.common.util.SqlInjectionUtil;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.online.auth.entity.OnlAuthData;
import org.jeecg.modules.online.auth.entity.OnlAuthPage;
import org.jeecg.modules.online.auth.entity.OnlAuthRelation;
import org.jeecg.modules.online.auth.service.IOnlAuthDataService;
import org.jeecg.modules.online.auth.service.IOnlAuthPageService;
import org.jeecg.modules.online.auth.service.IOnlAuthRelationService;
import org.jeecg.modules.online.cgform.consts.ExtendJsonKey;
import org.jeecg.modules.online.cgform.consts.OnlineConst;
import org.jeecg.modules.online.cgform.converter.p011b.DateFormatConverter;
import org.jeecg.modules.online.cgform.enhance.CgformEnhanceJavaImportInter;
import org.jeecg.modules.online.cgform.enhance.CgformEnhanceJavaInter;
import org.jeecg.modules.online.cgform.enhance.CgformEnhanceJavaListInter;
import org.jeecg.modules.online.cgform.enhance.impl.http.CgformEnhanceHttpFormImpl;
import org.jeecg.modules.online.cgform.enhance.impl.http.CgformEnhanceHttpListImpl;
import org.jeecg.modules.online.cgform.entity.OnlCgformButton;
import org.jeecg.modules.online.cgform.entity.OnlCgformEnhanceJava;
import org.jeecg.modules.online.cgform.entity.OnlCgformEnhanceJs;
import org.jeecg.modules.online.cgform.entity.OnlCgformEnhanceSql;
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
import org.jeecg.modules.online.cgform.entity.OnlCgformHead;
import org.jeecg.modules.online.cgform.entity.OnlCgformIndex;
import org.jeecg.modules.online.cgform.enums.CgformConstant;
import org.jeecg.modules.online.cgform.enums.EnhanceDataEnum;
import org.jeecg.modules.online.cgform.mapper.OnlCgformButtonMapper;
import org.jeecg.modules.online.cgform.mapper.OnlCgformEnhanceJavaMapper;
import org.jeecg.modules.online.cgform.mapper.OnlCgformEnhanceJsMapper;
import org.jeecg.modules.online.cgform.mapper.OnlCgformEnhanceSqlMapper;
import org.jeecg.modules.online.cgform.mapper.OnlCgformHeadMapper;
import org.jeecg.modules.online.cgform.model.OnlCgformModel;
import org.jeecg.modules.online.cgform.model.OnlGenerateModel;
import org.jeecg.modules.online.cgform.model.TreeSelectColumn;
import org.jeecg.modules.online.cgform.service.IOnlCgformFieldService;
import org.jeecg.modules.online.cgform.service.IOnlCgformHeadService;
import org.jeecg.modules.online.cgform.service.IOnlCgformIndexService;
import org.jeecg.modules.online.cgform.utils.CgformUtil;
import org.jeecg.modules.online.cgreport.constant.CgReportConstant;
import org.jeecg.modules.online.config.exception.BusinessException;
import org.jeecg.modules.online.config.exception.DBException;
import org.jeecg.modules.online.config.p020b.CgformConfigModel;
import org.jeecg.modules.online.config.p020b.DataBaseConfig;
import org.jeecg.modules.online.config.p020b.DmDataBaseConfig;
import org.jeecg.modules.online.config.p022d.DataBaseConst;
import org.jeecg.modules.online.config.p022d.DbTableProcess;
import org.jeecg.modules.online.config.p022d.DbTableUtil;
import org.jeecgframework.codegenerate.database.DbReadTableUtil;
import org.jeecgframework.codegenerate.generate.impl.CodeGenerateOne;
import org.jeecgframework.codegenerate.generate.impl.CodeGenerateOneToMany;
import org.jeecgframework.codegenerate.generate.pojo.ColumnVo;
import org.jeecgframework.codegenerate.generate.pojo.TableVo;
import org.jeecgframework.codegenerate.generate.pojo.onetomany.MainTableVo;
import org.jeecgframework.codegenerate.generate.pojo.onetomany.SubTableVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.dynamic.datasource.creator.DataSourceProperty;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import freemarker.template.TemplateException;

@Service("onlCgformHeadServiceImpl")
/* renamed from: org.jeecg.modules.online.cgform.service.a.d */
/* loaded from: hibernate-re-3.7.1-RC.jar:org/jeecg/modules/online/cgform/service/a/d.class */
public class OnlCgformHeadServiceImpl extends ServiceImpl<OnlCgformHeadMapper, OnlCgformHead> implements IOnlCgformHeadService {

    /* renamed from: a */
    private static final Logger f456a = LoggerFactory.getLogger(OnlCgformHeadServiceImpl.class);
    @Autowired
    private IOnlCgformFieldService fieldService;
    @Autowired
    private IOnlCgformIndexService indexService;
    @Autowired
    private OnlCgformEnhanceJsMapper onlCgformEnhanceJsMapper;
    @Autowired
    private OnlCgformButtonMapper onlCgformButtonMapper;
    @Autowired
    private OnlCgformEnhanceJavaMapper onlCgformEnhanceJavaMapper;
    @Autowired
    private OnlCgformEnhanceSqlMapper onlCgformEnhanceSqlMapper;
    @Autowired
    private IOnlCgformFieldService onlCgformFieldService;
    @Autowired
    private DataBaseConfig dataBaseConfig;
    @Autowired
    private IOnlAuthPageService onlAuthPageService;
    @Autowired
    private IOnlAuthDataService onlAuthDataService;
    @Autowired
    private IOnlAuthRelationService onlAuthRelationService;
    @Autowired
    private CgformEnhanceHttpFormImpl cgformEnhanceJavaHttp;
    @Autowired
    private CgformEnhanceHttpListImpl cgformEnhanceJavaListHttp;
    @Value("${jeecg.online.datasource:}")
    private String onlineDatasource;
    @Autowired
    @Lazy
    private ISysBaseAPI sysBaseApi;

    /* renamed from: a */
//    private static /* synthetic */ Object m207a(SerializedLambda serializedLambda) {
//        String implMethodName = serializedLambda.getImplMethodName();
//        boolean z = true;
//        switch (implMethodName.hashCode()) {
//            case -1998322493:
//                if (implMethodName.equals("getTableName")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case -1719285702:
//                if (implMethodName.equals("getButtonStatus")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case -1527749671:
//                if (implMethodName.equals("getCgformId")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case -1279489738:
//                if (implMethodName.equals("getDbIsPersist")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case -1243680498:
//                if (implMethodName.equals("getActiveStatus")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case -982778162:
//                if (implMethodName.equals("getOrderNum")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case -279031562:
//                if (implMethodName.equals("getCgJavaType")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case -221185875:
//                if (implMethodName.equals("getSubTableStr")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case 60299317:
//                if (implMethodName.equals("getButtonCode")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case 98245393:
//                if (implMethodName.equals("getId")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case 713008857:
//                if (implMethodName.equals("getCgformHeadId")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case 1010563698:
//                if (implMethodName.equals("getFieldValidType")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case 1088822109:
//                if (implMethodName.equals("getPhysicId")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case 1884224617:
//                if (implMethodName.equals("getButtonStyle")) {
//                    z = true;
//                    break;
//                }
//                break;
//            case 1952717028:
//                if (implMethodName.equals("getEvent")) {
//                    z = false;
//                    break;
//                }
//                break;
//            case 1968414493:
//                if (implMethodName.equals("getCgJsType")) {
//                    z = true;
//                    break;
//                }
//                break;
//        }
//        switch (z) {
//            case false:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getEvent();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getEvent();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getEvent();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//                    return (v0) -> {
//                        return v0.getOrderNum();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformButton") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//                    return (v0) -> {
//                        return v0.getOrderNum();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformButton") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//                    return (v0) -> {
//                        return v0.getOrderNum();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformButton") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//                    return (v0) -> {
//                        return v0.getOrderNum();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//                    return (v0) -> {
//                        return v0.getOrderNum();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformIndex") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformIndex") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJs") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceSql") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformButton") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformButton") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceSql") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformButton") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJs") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformIndex") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformHeadId();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getTableName();
//                    };
//                }
//                break;
//            case AuthConstants.f111o /* 4 */:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformButton") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getButtonStyle();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformButton") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getButtonStyle();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgJavaType();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getFieldValidType();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/auth/entity/OnlAuthRelation") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/auth/entity/OnlAuthData") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/auth/entity/OnlAuthPage") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgformId();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getId();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//                    return (v0) -> {
//                        return v0.getDbIsPersist();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformField") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//                    return (v0) -> {
//                        return v0.getDbIsPersist();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceSql") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getButtonCode();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getButtonCode();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getButtonCode();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getButtonCode();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getButtonCode();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceSql") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getButtonCode();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJs") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgJsType();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJs") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getCgJsType();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getActiveStatus();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getActiveStatus();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformEnhanceJava") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getActiveStatus();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getPhysicId();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getPhysicId();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformHead") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getSubTableStr();
//                    };
//                }
//                break;
//            case true:
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformButton") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getButtonStatus();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformButton") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getButtonStatus();
//                    };
//                }
//                if (serializedLambda.getImplMethodKind() == 5 && serializedLambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && serializedLambda.getFunctionalInterfaceMethodName().equals("apply") && serializedLambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && serializedLambda.getImplClass().equals("org/jeecg/modules/online/cgform/entity/OnlCgformButton") && serializedLambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//                    return (v0) -> {
//                        return v0.getButtonStatus();
//                    };
//                }
//                break;
//        }
//        throw new IllegalArgumentException("Invalid lambda deserialization");
//    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    @Transactional(rollbackFor = {Exception.class})
    public Result<?> addAll(OnlCgformModel model) {
        String replace = UUID.randomUUID().toString().replace("-", "");
        OnlCgformHead head = model.getHead();
        List<OnlCgformField> fields = model.getFields();
        List<OnlCgformIndex> indexs = model.getIndexs();
        head.setId(replace);
        boolean z = false;
        for (int i = 0; i < fields.size(); i++) {
            OnlCgformField onlCgformField = fields.get(i);
            onlCgformField.setId(null);
            onlCgformField.setCgformHeadId(replace);
            if (onlCgformField.getOrderNum() == null) {
                onlCgformField.setOrderNum(Integer.valueOf(i));
            }
            if (oConvertUtils.isNotEmpty(onlCgformField.getMainTable()) && oConvertUtils.isNotEmpty(onlCgformField.getMainField())) {
                z = true;
            }
            m203a(onlCgformField);
            if (onlCgformField.getDbIsPersist() == null) {
                onlCgformField.setDbIsPersist(OnlineConst.f140b);
            }
        }
        for (OnlCgformIndex onlCgformIndex : indexs) {
            onlCgformIndex.setId(null);
            onlCgformIndex.setCgformHeadId(replace);
            onlCgformIndex.setIsDbSynch("N");
            onlCgformIndex.setDelFlag(CommonConstant.DEL_FLAG_0);
        }
        head.setIsDbSynch("N");
        head.setQueryMode("single");
        head.setTableVersion(1);
        head.setCopyType(0);
        if (head.getTableType().intValue() == 3 && head.getTabOrderNum() == null) {
            head.setTabOrderNum(1);
        }
        super.save(head);
        this.fieldService.saveBatch(fields);
        this.indexService.saveBatch(indexs);
        m200a(head, fields);
        if (head.getTableType().intValue() == 3 && z) {
            this.onlCgformFieldService.clearCacheOnlineConfig();
        }
        return Result.ok("添加成功");
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    @Transactional(rollbackFor = {Exception.class})
    public Result<?> editAll(OnlCgformModel model) {
        OnlCgformHead head = model.getHead();
        OnlCgformHead onlCgformHead = (OnlCgformHead) super.getById(head.getId());
        if (onlCgformHead == null) {
            return Result.error("未找到对应实体");
        }
        String isDbSynch = onlCgformHead.getIsDbSynch();
        if (CgformUtil.m348a(onlCgformHead, head)) {
            isDbSynch = "N";
        }
        Integer tableVersion = onlCgformHead.getTableVersion();
        if (tableVersion == null) {
            tableVersion = 1;
        }
        head.setTableVersion(Integer.valueOf(tableVersion.intValue() + 1));
        List<OnlCgformField> fields = model.getFields();
        List<OnlCgformIndex> indexs = model.getIndexs();
        List<OnlCgformField> arrayList = new ArrayList();
        ArrayList<OnlCgformField> arrayList2 = new ArrayList();
        for (OnlCgformField onlCgformField : fields) {
            String valueOf = String.valueOf(onlCgformField.getId());
            m203a(onlCgformField);
            if (valueOf.length() == 32) {
                arrayList2.add(onlCgformField);
            } else if (!"_pk".equals(valueOf)) {
                onlCgformField.setId(null);
                onlCgformField.setCgformHeadId(head.getId());
                arrayList.add(onlCgformField);
            }
            if (onlCgformField.getDbIsPersist() == null) {
                onlCgformField.setDbIsPersist(OnlineConst.f140b);
            }
        }
        if (arrayList.size() > 0 && m206a(arrayList)) {
            isDbSynch = "N";
        }
        int i = 0;
        for (OnlCgformField onlCgformField2 : arrayList2) {
            OnlCgformField onlCgformField3 = (OnlCgformField) this.fieldService.getById(onlCgformField2.getId());
            m210a(onlCgformField3.getMainTable(), head.getTableName());
            if (CgformUtil.m350a(onlCgformField3, onlCgformField2)) {
                isDbSynch = "N";
            }
            if ((onlCgformField3.getOrderNum() == null ? 0 : onlCgformField3.getOrderNum().intValue()) > i) {
                i = onlCgformField3.getOrderNum().intValue();
            }
            if ("Y".equals(onlCgformHead.getIsDbSynch()) && !onlCgformField2.getDbFieldName().equals(onlCgformField3.getDbFieldName())) {
                onlCgformField2.setDbFieldNameOld(onlCgformField3.getDbFieldName());
            }
            UpdateWrapper<OnlCgformField> updateWrapper = new UpdateWrapper();
            updateWrapper.lambda().eq(OnlCgformField::getId, onlCgformField2.getId());
            if (onlCgformField2.getFieldValidType() == null) {
                updateWrapper.lambda().set(OnlCgformField::getFieldValidType, "");
            }
            this.fieldService.update(onlCgformField2, updateWrapper);
        }
        for (OnlCgformField onlCgformField4 : arrayList) {
            if (onlCgformField4.getOrderNum() == null) {
                i++;
                onlCgformField4.setOrderNum(Integer.valueOf(i));
            }
            this.fieldService.save(onlCgformField4);
        }
        List<OnlCgformIndex> cgformIndexsByCgformId = this.indexService.getCgformIndexsByCgformId(head.getId());
        ArrayList arrayList3 = new ArrayList();
        ArrayList<OnlCgformIndex> arrayList4 = new ArrayList();
        for (OnlCgformIndex onlCgformIndex : indexs) {
            if (String.valueOf(onlCgformIndex.getId()).length() == 32) {
                arrayList4.add(onlCgformIndex);
            } else {
                onlCgformIndex.setId(null);
                onlCgformIndex.setIsDbSynch("N");
                onlCgformIndex.setDelFlag(CommonConstant.DEL_FLAG_0);
                onlCgformIndex.setCgformHeadId(head.getId());
                arrayList3.add(onlCgformIndex);
            }
        }
        for (OnlCgformIndex onlCgformIndex2 : cgformIndexsByCgformId) {
            if (!indexs.stream().anyMatch(onlCgformIndex3 -> {
                return onlCgformIndex2.getId().equals(onlCgformIndex3.getId());
            })) {
                onlCgformIndex2.setDelFlag(CommonConstant.DEL_FLAG_1);
                arrayList4.add(onlCgformIndex2);
                isDbSynch = "N";
            }
        }
        if (arrayList3.size() > 0) {
            isDbSynch = "N";
            this.indexService.saveBatch(arrayList3);
        }
        for (OnlCgformIndex onlCgformIndex4 : arrayList4) {
            OnlCgformIndex onlCgformIndex5 = (OnlCgformIndex) this.indexService.getById(onlCgformIndex4.getId());
            if (CgformUtil.m347a(onlCgformIndex5, onlCgformIndex4)) {
                isDbSynch = "N";
                onlCgformIndex4.setIsDbSynch("N");
                if (!onlCgformIndex5.getIndexName().trim().equalsIgnoreCase(onlCgformIndex4.getIndexName().trim())) {
                    onlCgformIndex4.setIndexNameOld(onlCgformIndex5.getIndexName());
                }
            }
            this.indexService.updateById(onlCgformIndex4);
        }
        if (model.getDeleteFieldIds().size() > 0) {
            for (String str : model.getDeleteFieldIds()) {
                OnlCgformField onlCgformField5 = (OnlCgformField) this.fieldService.getById(str);
                if (onlCgformField5 != null) {
                    if (OnlineConst.f140b.equals(onlCgformField5.getDbIsPersist())) {
                        isDbSynch = "N";
                    }
                    m210a(onlCgformField5.getMainTable(), head.getTableName());
                    this.fieldService.removeById(str);
                }
            }
        }
        head.setIsDbSynch(isDbSynch);
        super.updateById(head);
        m200a(head, fields);
        m192b(head, fields);
        return Result.ok("全部修改成功");
    }

    /* renamed from: a */
    private boolean m206a(List<OnlCgformField> list) {
        if (list == null || list.size() == 0) {
            return false;
        }
        boolean z = false;
        Iterator<OnlCgformField> it = list.iterator();
        while (true) {
            if (!it.hasNext()) {
                break;
            }
            if (OnlineConst.f140b.equals(it.next().getDbIsPersist())) {
                z = true;
                break;
            }
        }
        return z;
    }

    /* renamed from: a */
    private void m210a(String str, String str2) {
        if (oConvertUtils.isNotEmpty(str)) {
            OnlCgformHead onlCgformHead = (this.baseMapper).selectOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, str));
            if (onlCgformHead != null && oConvertUtils.isNotEmpty(onlCgformHead.getSubTableStr())) {
                String[] split = onlCgformHead.getSubTableStr().split(CgformUtil.f233E);
                ArrayList arrayList = new ArrayList();
                for (String str3 : split) {
                    if (!str3.equals(str2)) {
                        arrayList.add(str3);
                    }
                }
                onlCgformHead.setSubTableStr(String.join(CgformUtil.f233E, arrayList));
                ((OnlCgformHeadMapper) this.baseMapper).updateById(onlCgformHead);
            }
        }
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void doDbSynch(String code, String synMethod) throws HibernateException, IOException, TemplateException, SQLException, DBException {
        OnlCgformHead onlCgformHead = (OnlCgformHead) getById(code);
        if (onlCgformHead == null) {
            throw new DBException("实体配置不存在");
        }
        String tableName = onlCgformHead.getTableName();
        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, code);
        lambdaQueryWrapper.eq(OnlCgformField::getDbIsPersist, OnlineConst.f140b);
        lambdaQueryWrapper.orderByAsc(OnlCgformField::getOrderNum);
        List<OnlCgformField> list = this.fieldService.list(lambdaQueryWrapper);
        CgformConfigModel cgformConfigModel = new CgformConfigModel();
        cgformConfigModel.setTableName(tableName);
        cgformConfigModel.setJformPkType(onlCgformHead.getIdType());
        cgformConfigModel.setJformPkSequence(onlCgformHead.getIdSequence());
        cgformConfigModel.setContent(onlCgformHead.getTableTxt());
        cgformConfigModel.setColumns(list);
        DataBaseConfig onlineDataBaseConfig = getOnlineDataBaseConfig();
        cgformConfigModel.setDbConfig(onlineDataBaseConfig);
        DbType m27c = DbTableUtil.m27c(onlineDataBaseConfig);
        if (CgformUtil.f239K.equals(synMethod) && !m27c.equals(DbType.SQLITE)) {
            System.currentTimeMillis();
            if (DbTableUtil.m36a(tableName, onlineDataBaseConfig).booleanValue()) {
                DbTableProcess dbTableProcess = new DbTableProcess(onlineDataBaseConfig);
                for (String str : dbTableProcess.m46b(cgformConfigModel)) {
                    if (!oConvertUtils.isEmpty(str) && !oConvertUtils.isEmpty(str.trim())) {
                        String[] split = str.split(";");
                        if (split == null || split.length <= 1) {
                        }
                        for (String str2 : split) {
                            if (!oConvertUtils.isEmpty(str2) && !oConvertUtils.isEmpty(str2.trim())) {
                                ((OnlCgformHeadMapper) this.baseMapper).executeDDL(str2);
                            }
                        }
                    }
                }
                for (OnlCgformIndex onlCgformIndex : this.indexService.list(new LambdaQueryWrapper<OnlCgformIndex>().eq(OnlCgformIndex::getCgformHeadId, code))) {
                    if ("N".equals(onlCgformIndex.getIsDbSynch()) || CommonConstant.DEL_FLAG_1.equals(onlCgformIndex.getDelFlag())) {
                        String string = oConvertUtils.getString(onlCgformIndex.getIndexNameOld(), onlCgformIndex.getIndexName());
                        if (this.indexService.isExistIndex(dbTableProcess.m47b(string, tableName))) {
                            try {
                                ((OnlCgformHeadMapper) this.baseMapper).executeDDL(dbTableProcess.m57a(string, tableName));
                                if (CommonConstant.DEL_FLAG_1.equals(onlCgformIndex.getDelFlag())) {
                                    this.indexService.removeById(onlCgformIndex.getId());
                                } else {
                                    onlCgformIndex.setIndexNameOld("");
                                    this.indexService.updateById(onlCgformIndex);
                                }
                            } catch (Exception e) {
                                f456a.error("删除表【" + tableName + "】索引(" + onlCgformIndex.getIndexName() + ")失败!", e);
                            }
                        } else if (CommonConstant.DEL_FLAG_1.equals(onlCgformIndex.getDelFlag())) {
                            this.indexService.removeById(onlCgformIndex.getId());
                        }
                    }
                }
            } else {
                DbTableProcess.m53a(cgformConfigModel);
            }
        } else if (CgformUtil.f238J.equals(synMethod) || m27c.equals(DbType.SQLITE)) {
            ((OnlCgformHeadMapper) this.baseMapper).executeDDL(DbTableUtil.getTableHandle().dropTableSQL(tableName));
            DbTableProcess.m53a(cgformConfigModel);
        }
        this.indexService.createIndex(code, DbTableUtil.getDatabaseType(), tableName, synMethod);
        onlCgformHead.setIsDbSynch("Y");
        if (onlCgformHead.getTableVersion().intValue() == 1) {
            onlCgformHead.setTableVersion(2);
        }
        updateById(onlCgformHead);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void deleteRecordAndTable(String id) throws DBException, SQLException {
        OnlCgformHead onlCgformHead = (OnlCgformHead) getById(id);
        if (onlCgformHead == null) {
            throw new DBException("实体配置不存在");
        }
        System.currentTimeMillis();
        if (DbTableUtil.m38a(onlCgformHead.getTableName()).booleanValue()) {
            ((OnlCgformHeadMapper) this.baseMapper).executeDDL(DbTableUtil.getTableHandle().dropTableSQL(onlCgformHead.getTableName()));
        }
        deleteRecord(id);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void deleteRecord(String id) throws DBException, SQLException {
        OnlCgformHead onlCgformHead = (OnlCgformHead) getById(id);
        if (onlCgformHead == null) {
            throw new DBException("实体配置不存在");
        }
        LambdaQueryWrapper<OnlCgformHead> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformHead::getPhysicId, id);
        List<OnlCgformHead> selectList = this.baseMapper.selectList(lambdaQueryWrapper);
        if (selectList != null && selectList.size() > 0) {
            for (OnlCgformHead onlCgformHead2 : selectList) {
                m212a(onlCgformHead2.getId());
            }
        }
        m201a(onlCgformHead);
        m212a(id);
        if (onlCgformHead.getTableType().intValue() == 3) {
            this.onlCgformFieldService.clearCacheOnlineConfig();
        }
    }

    /* renamed from: a */
    private void m212a(String str) {
        this.baseMapper.deleteById(str);
        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, str);
        this.fieldService.remove(lambdaQueryWrapper);
        LambdaQueryWrapper<OnlCgformIndex>  lambdaQueryWrapper2 = new LambdaQueryWrapper();
        lambdaQueryWrapper2.eq(OnlCgformIndex::getCgformHeadId, str);
        this.indexService.remove(lambdaQueryWrapper2);
        LambdaQueryWrapper<OnlAuthRelation> lambdaQueryWrapper3 = new LambdaQueryWrapper();
        lambdaQueryWrapper3.eq(OnlAuthRelation::getCgformId, str);
        this.onlAuthRelationService.remove(lambdaQueryWrapper3);
        LambdaQueryWrapper<OnlAuthData> lambdaQueryWrapper4 = new LambdaQueryWrapper();
        lambdaQueryWrapper4.eq(OnlAuthData::getCgformId, str);
        this.onlAuthDataService.remove(lambdaQueryWrapper4);
        LambdaQueryWrapper<OnlAuthPage> lambdaQueryWrapper5 = new LambdaQueryWrapper();
        lambdaQueryWrapper5.eq(OnlAuthPage::getCgformId, str);
        this.onlAuthPageService.remove(lambdaQueryWrapper5);
    }

    /* renamed from: a */
    private void m201a(OnlCgformHead onlCgformHead) {
        OnlCgformHead onlCgformHead2;
        if (onlCgformHead.getTableType().intValue() == 3) {
            String str = null;
            for (OnlCgformField onlCgformField : this.fieldService.list(new LambdaQueryWrapper<OnlCgformField>().eq(OnlCgformField::getCgformHeadId, onlCgformHead.getId()))) {
                str = onlCgformField.getMainTable();
                if (oConvertUtils.isNotEmpty(str)) {
                    break;
                }
            }
            if (oConvertUtils.isNotEmpty(str) && (onlCgformHead2 = this.baseMapper.selectOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, str))) != null) {
                String subTableStr = onlCgformHead2.getSubTableStr();
                if (oConvertUtils.isNotEmpty(subTableStr)) {
                    List list = (List) Arrays.asList(subTableStr.split(CgformUtil.f233E)).stream().collect(Collectors.toList());
                    list.remove(onlCgformHead.getTableName());
                    onlCgformHead2.setSubTableStr(String.join(CgformUtil.f233E, list));
                    ((OnlCgformHeadMapper) this.baseMapper).updateById(onlCgformHead2);
                }
            }
        }
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public List<Map<String, Object>> queryListData(String sql) {
        return ((OnlCgformHeadMapper) this.baseMapper).queryList(sql);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void saveEnhance(OnlCgformEnhanceJs onlCgformEnhanceJs) {
        this.onlCgformEnhanceJsMapper.insert(onlCgformEnhanceJs);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public OnlCgformEnhanceJs queryEnhance(String code, String type) {
        return this.onlCgformEnhanceJsMapper.selectOne( (new LambdaQueryWrapper<OnlCgformEnhanceJs>().eq(OnlCgformEnhanceJs::getCgJsType, type))
        		.eq(OnlCgformEnhanceJs::getCgformHeadId, code));
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void editEnhance(OnlCgformEnhanceJs onlCgformEnhanceJs) {
        this.onlCgformEnhanceJsMapper.updateById(onlCgformEnhanceJs);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public OnlCgformEnhanceSql queryEnhanceSql(String formId, String buttonCode) {
        return  this.onlCgformEnhanceSqlMapper.selectOne( ( new LambdaQueryWrapper<OnlCgformEnhanceSql>().eq(OnlCgformEnhanceSql::getCgformHeadId, formId))
        		.eq(OnlCgformEnhanceSql::getButtonCode, buttonCode));
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public OnlCgformEnhanceJava queryEnhanceJava(OnlCgformEnhanceJava onlCgformEnhanceJava) {
    	LambdaQueryWrapper<OnlCgformEnhanceJava> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getButtonCode, onlCgformEnhanceJava.getButtonCode());
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getCgformHeadId, onlCgformEnhanceJava.getCgformHeadId());
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getCgJavaType, onlCgformEnhanceJava.getCgJavaType());
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getEvent, onlCgformEnhanceJava.getEvent());
        return this.onlCgformEnhanceJavaMapper.selectOne(lambdaQueryWrapper);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public List<OnlCgformButton> queryButtonList(String code, boolean isListButton) {
    	LambdaQueryWrapper<OnlCgformButton> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformButton::getButtonStatus, "1");
        lambdaQueryWrapper.eq(OnlCgformButton::getCgformHeadId, code);
        if (isListButton) {
            lambdaQueryWrapper.in(OnlCgformButton::getButtonStyle, new Object[]{"link", "button"});
        } else {
            lambdaQueryWrapper.eq(OnlCgformButton::getButtonStyle, CgformUtil.f271aq);
        }
        lambdaQueryWrapper.orderByAsc(OnlCgformButton::getOrderNum);
        return this.onlCgformButtonMapper.selectList(lambdaQueryWrapper);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public List<OnlCgformButton> queryButtonList(String code) {
    	LambdaQueryWrapper<OnlCgformButton> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformButton::getButtonStatus, "1");
        lambdaQueryWrapper.eq(OnlCgformButton::getCgformHeadId, code);
        lambdaQueryWrapper.orderByAsc(OnlCgformButton::getOrderNum);
        return this.onlCgformButtonMapper.selectList(lambdaQueryWrapper);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public List<String> queryOnlinetables() {
        return ((OnlCgformHeadMapper) this.baseMapper).queryOnlinetables();
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    @Transactional(rollbackFor = {Exception.class})
    public void saveDbTable2Online(String tbname) throws Exception {
        OnlCgformHead onlCgformHead = new OnlCgformHead();
        onlCgformHead.setTableType(1);
        onlCgformHead.setIsCheckbox("Y");
        onlCgformHead.setIsDbSynch(checkTableExist(tbname) ? "Y" : "N");
        onlCgformHead.setIsTree("N");
        onlCgformHead.setIsPage("Y");
        onlCgformHead.setQueryMode(CgReportConstant.f505K);
        onlCgformHead.setTableName(tbname.toLowerCase());
        onlCgformHead.setTableTxt(tbname);
        onlCgformHead.setTableVersion(1);
        onlCgformHead.setFormTemplate("1");
        onlCgformHead.setCopyType(0);
        onlCgformHead.setIsDesForm("N");
        onlCgformHead.setScroll(1);
        onlCgformHead.setThemeTemplate(CgformUtil.f239K);
        String generate = UUIDGenerator.generate();
        onlCgformHead.setId(generate);
        ArrayList arrayList = new ArrayList();
        try {
            List<ColumnVo>  readOriginalTableColumn = DbReadTableUtil.readOriginalTableColumn(tbname);
            if (!readOriginalTableColumn.stream().anyMatch(columnVo -> {
                return columnVo.getFieldName().equalsIgnoreCase("id");
            })) {
                throw new TuringBootBizTipException("缺少ID字段，不能同步");
            }
            for (int i = 0; i < readOriginalTableColumn.size(); i++) {
                ColumnVo columnVo2 = (ColumnVo) readOriginalTableColumn.get(i);
                String fieldDbName = columnVo2.getFieldDbName();
                OnlCgformField onlCgformField = new OnlCgformField();
                onlCgformField.setCgformHeadId(generate);
                onlCgformField.setDbFieldNameOld(columnVo2.getFieldDbName().toLowerCase());
                onlCgformField.setDbFieldName(columnVo2.getFieldDbName().toLowerCase());
                if (oConvertUtils.isNotEmpty(columnVo2.getFiledComment())) {
                    onlCgformField.setDbFieldTxt(columnVo2.getFiledComment());
                } else {
                    onlCgformField.setDbFieldTxt(columnVo2.getFieldName());
                }
                onlCgformField.setDbIsKey(0);
                onlCgformField.setIsShowForm(1);
                onlCgformField.setIsQuery(0);
                onlCgformField.setFieldMustInput(CgformUtil.f304aX);
                onlCgformField.setIsShowList(1);
                onlCgformField.setOrderNum(Integer.valueOf(i + 1));
                onlCgformField.setQueryMode("single");
                onlCgformField.setDbLength(Integer.valueOf(oConvertUtils.getInt(columnVo2.getPrecision())));
                onlCgformField.setFieldLength(120);
                onlCgformField.setDbPointLength(Integer.valueOf(oConvertUtils.getInt(columnVo2.getScale())));
                onlCgformField.setFieldShowType(ExtendJsonKey.f133f);
                onlCgformField.setDbIsNull(Integer.valueOf("Y".equals(columnVo2.getNullable()) ? 1 : 0));
                onlCgformField.setIsReadOnly(0);
                if ("id".equalsIgnoreCase(fieldDbName)) {
                    if (Arrays.asList("java.lang.Integer", "java.lang.Long").contains(columnVo2.getFieldType())) {
                        onlCgformHead.setIdType("NATIVE");
                    } else {
                        onlCgformHead.setIdType("UUID");
                    }
                    onlCgformField.setDbIsKey(1);
                    onlCgformField.setIsShowForm(0);
                    onlCgformField.setIsShowList(0);
                    onlCgformField.setIsReadOnly(1);
                }
                if ("create_by".equalsIgnoreCase(fieldDbName) || "create_time".equalsIgnoreCase(fieldDbName) || "update_by".equalsIgnoreCase(fieldDbName) || "update_time".equalsIgnoreCase(fieldDbName) || "sys_org_code".equalsIgnoreCase(fieldDbName)) {
                    onlCgformField.setIsShowForm(0);
                    onlCgformField.setIsShowList(0);
                }
                if ("java.lang.Integer".equalsIgnoreCase(columnVo2.getFieldType())) {
                    onlCgformField.setDbType("int");
                } else if ("java.lang.Long".equalsIgnoreCase(columnVo2.getFieldType())) {
                    onlCgformField.setDbType("int");
                } else if ("java.util.Date".equalsIgnoreCase(columnVo2.getFieldType())) {
                    if ("datetime".equals(columnVo2.getFieldDbType())) {
                        onlCgformField.setDbType("Datetime");
                        onlCgformField.setFieldShowType("datetime");
                    } else {
                        onlCgformField.setDbType("Date");
                        onlCgformField.setFieldShowType("date");
                    }
                } else if ("java.lang.Double".equalsIgnoreCase(columnVo2.getFieldType()) || "java.lang.Float".equalsIgnoreCase(columnVo2.getFieldType())) {
                    onlCgformField.setDbType("double");
                } else if ("java.math.BigDecimal".equalsIgnoreCase(columnVo2.getFieldType()) || "BigDecimal".equalsIgnoreCase(columnVo2.getFieldType())) {
                    onlCgformField.setDbType("BigDecimal");
                } else if ("byte[]".equalsIgnoreCase(columnVo2.getFieldType()) || columnVo2.getFieldType().contains("blob")) {
                    onlCgformField.setDbType("Blob");
                    columnVo2.setCharmaxLength((String) null);
                } else if ("java.lang.Object".equals(columnVo2.getFieldType()) && (ExtendJsonKey.f133f.equalsIgnoreCase(columnVo2.getFieldDbType()) || "ntext".equalsIgnoreCase(columnVo2.getFieldDbType()))) {
                    onlCgformField.setDbType(DataBaseConst.f579j);
                    onlCgformField.setFieldShowType(DataBaseConst.f580k);
                } else if ("java.lang.Object".equals(columnVo2.getFieldType()) && "image".equalsIgnoreCase(columnVo2.getFieldDbType())) {
                    onlCgformField.setDbType("Blob");
                } else {
                    onlCgformField.setDbType("string");
                }
                if (oConvertUtils.isEmpty(columnVo2.getPrecision()) && oConvertUtils.isNotEmpty(columnVo2.getCharmaxLength())) {
                    if (Long.valueOf(columnVo2.getCharmaxLength()).longValue() >= 3000) {
                        onlCgformField.setDbType(DataBaseConst.f579j);
                        onlCgformField.setFieldShowType(DataBaseConst.f580k);
                        try {
                            onlCgformField.setDbLength(Integer.valueOf(columnVo2.getCharmaxLength()));
                        } catch (Exception e) {
                            f456a.error(e.getMessage(), e);
                        }
                    } else {
                        onlCgformField.setDbLength(Integer.valueOf(columnVo2.getCharmaxLength()));
                    }
                } else {
                    if (oConvertUtils.isNotEmpty(columnVo2.getPrecision())) {
                        onlCgformField.setDbLength(Integer.valueOf(columnVo2.getPrecision()));
                    } else if (onlCgformField.getDbType().equals("int")) {
                        onlCgformField.setDbLength(10);
                    }
                    if (oConvertUtils.isNotEmpty(columnVo2.getScale())) {
                        onlCgformField.setDbPointLength(Integer.valueOf(columnVo2.getScale()));
                    }
                }
                if (oConvertUtils.getInt(columnVo2.getPrecision()) == -1 && oConvertUtils.getInt(columnVo2.getScale()) == 0) {
                    onlCgformField.setDbType(DataBaseConst.f579j);
                }
                if ("Blob".equals(onlCgformField.getDbType()) || DataBaseConst.f579j.equals(onlCgformField.getDbType()) || "Date".equals(onlCgformField.getDbType())) {
                    onlCgformField.setDbLength(0);
                    onlCgformField.setDbPointLength(0);
                }
                onlCgformField.setDbIsPersist(OnlineConst.f140b);
                arrayList.add(onlCgformField);
            }
            if (oConvertUtils.isEmpty(onlCgformHead.getFormCategory())) {
                onlCgformHead.setFormCategory("bdfl_include");
            }
            save(onlCgformHead);
            this.fieldService.saveBatch(arrayList);
        } catch (Exception e2) {
            f456a.error(e2.getMessage(), e2);
            throw e2;
        }
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public boolean checkTableExist(String tbname) {
        try {
            ((OnlCgformHeadMapper) this.baseMapper).queryCountByTableName(SqlInjectionUtil.getSqlInjectTableName(tbname));
            return true;
        } catch (Exception e) {
            return false;
        }
    }

    /* renamed from: b */
    private boolean m196b(String str, String str2) {
        if (oConvertUtils.isEmpty(str2)) {
            return false;
        }
        for (String str3 : str2.split(CgformUtil.f233E)) {
            if (str3.equalsIgnoreCase(str)) {
                return true;
            }
        }
        return false;
    }

    /* renamed from: a */
    private void m200a(OnlCgformHead onlCgformHead, List<OnlCgformField> list) {
        OnlCgformHead onlCgformHead2;
        if (onlCgformHead.getTableType().intValue() == 3) {
            OnlCgformHead onlCgformHead3 = (OnlCgformHead) ((OnlCgformHeadMapper) this.baseMapper).selectById(onlCgformHead.getId());
            for (int i = 0; i < list.size(); i++) {
                String mainTable = list.get(i).getMainTable();
                if (!oConvertUtils.isEmpty(mainTable) && (onlCgformHead2 = this.baseMapper.selectOne( new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, mainTable))) != null) {
                    String subTableStr = onlCgformHead2.getSubTableStr();
                    if (oConvertUtils.isEmpty(subTableStr)) {
                        subTableStr = onlCgformHead3.getTableName();
                    } else if (!m196b(onlCgformHead3.getTableName(), subTableStr)) {
                        ArrayList arrayList = new ArrayList(Arrays.asList(subTableStr.split(CgformUtil.f233E)));
                        int i2 = 0;
                        while (true) {
                            if (i2 >= arrayList.size()) {
                                break;
                            }
                            OnlCgformHead onlCgformHead4 = this.baseMapper.selectOne( new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, (String) arrayList.get(i2)));
                            if (onlCgformHead4 == null || onlCgformHead3.getTabOrderNum().intValue() >= oConvertUtils.getInt(onlCgformHead4.getTabOrderNum(), 0)) {
                                i2++;
                            } else {
                                arrayList.add(i2, onlCgformHead3.getTableName());
                                break;
                            }
                        }
                        if (arrayList.indexOf(onlCgformHead3.getTableName()) < 0) {
                            arrayList.add(onlCgformHead3.getTableName());
                        }
                        subTableStr = String.join(CgformUtil.f233E, arrayList);
                    }
                    onlCgformHead2.setSubTableStr(subTableStr);
                    ((OnlCgformHeadMapper) this.baseMapper).updateById(onlCgformHead2);
                    return;
                }
            }
            return;
        }
        List<OnlCgformHead> selectList = this.baseMapper.selectList(new LambdaQueryWrapper<OnlCgformHead>().like(OnlCgformHead::getSubTableStr, onlCgformHead.getTableName()));
        if (selectList != null && selectList.size() > 0) {
            for (OnlCgformHead onlCgformHead5 : selectList) {
                String subTableStr2 = onlCgformHead5.getSubTableStr();
                if (onlCgformHead5.getSubTableStr().equals(onlCgformHead.getTableName())) {
                    subTableStr2 = "";
                } else if (onlCgformHead5.getSubTableStr().startsWith(onlCgformHead.getTableName() + CgformUtil.f233E)) {
                    subTableStr2 = subTableStr2.replace(onlCgformHead.getTableName() + CgformUtil.f233E, "");
                } else if (onlCgformHead5.getSubTableStr().endsWith(CgformUtil.f233E + onlCgformHead.getTableName())) {
                    subTableStr2 = subTableStr2.replace(CgformUtil.f233E + onlCgformHead.getTableName(), "");
                } else if (onlCgformHead5.getSubTableStr().indexOf(CgformUtil.f233E + onlCgformHead.getTableName() + CgformUtil.f233E) != -1) {
                    subTableStr2 = subTableStr2.replace(CgformUtil.f233E + onlCgformHead.getTableName() + CgformUtil.f233E, CgformUtil.f233E);
                }
                onlCgformHead5.setSubTableStr(subTableStr2);
                ((OnlCgformHeadMapper) this.baseMapper).updateById(onlCgformHead5);
            }
        }
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    @Transactional(rollbackFor = {Exception.class})
    public String saveManyFormData(String code, JSONObject json, String xAccessToken) throws DBException, BusinessException {
        Integer queryCountBySql;
        String[] split;
        OnlCgformHead onlCgformHead;
        OnlCgformHead table = getTable(code);
        executeEnhanceJava(CgformConstant.f374i, CgformUtil.f274at, table, json);
        String m317f = CgformUtil.m317f(table.getTableName());
        if (table.getTableType().intValue() == 2) {
            String subTableStr = table.getSubTableStr();
            if (oConvertUtils.isNotEmpty(subTableStr)) {
                for (String str : subTableStr.split(CgformUtil.f233E)) {
                    JSONArray jSONArray = json.getJSONArray(str);
                    if (jSONArray != null && jSONArray.size() != 0 && (onlCgformHead =  this.baseMapper.selectOne( new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, str))) != null) {
                        List<OnlCgformField> list = this.fieldService.list(new LambdaQueryWrapper<OnlCgformField>().eq(OnlCgformField::getCgformHeadId, onlCgformHead.getId()));
                        String str2 = "";
                        String str3 = null;
                        for (OnlCgformField onlCgformField : list) {
                            if (!oConvertUtils.isEmpty(onlCgformField.getMainField())) {
                                str2 = onlCgformField.getDbFieldName();
                                String mainField = onlCgformField.getMainField();
                                if (json.get(mainField.toLowerCase()) != null) {
                                    str3 = json.getString(mainField.toLowerCase());
                                }
                                if (json.get(mainField.toUpperCase()) != null) {
                                    str3 = json.getString(mainField.toUpperCase());
                                }
                            }
                        }
                        for (int i = 0; i < jSONArray.size(); i++) {
                            JSONObject jSONObject = jSONArray.getJSONObject(i);
                            if (str3 != null) {
                                jSONObject.put(str2, str3);
                            }
                            this.fieldService.saveFormData(list, str, jSONObject);
                        }
                    }
                }
            }
        } else if (CgformConstant.f368c.equals(table.getTableType()) && table.getRelationType().intValue() == 1 && null != (queryCountBySql = this.fieldService.queryCountBySql(m317f, null, null)) && queryCountBySql.intValue() > 1) {
            throw new TuringBootException("一对一的表只能新增一条数据");
        }
        if ("Y".equals(table.getIsTree())) {
            this.fieldService.saveTreeFormData(table.getId(), m317f, json, table.getTreeIdField(), table.getTreeParentIdField());
        } else {
            this.fieldService.saveFormData(table.getId(), m317f, json, false);
        }
        executeEnhanceSql(CgformConstant.f374i, table.getId(), json);
        executeEnhanceJava(CgformConstant.f374i, "end", table, json);
        return table.getTableName();
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public Map<String, Object> querySubFormData(String table, String mainId) throws DBException {
        new HashMap(5);
        OnlCgformHead onlCgformHead = getOne( new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, table));
        if (onlCgformHead == null) {
            throw new DBException("数据库子表[" + table + "]不存在");
        }
        List<OnlCgformField> queryFormFields = this.fieldService.queryFormFields(onlCgformHead.getId(), false);
        String str = null;
        Iterator<OnlCgformField> it = queryFormFields.iterator();
        while (true) {
            if (!it.hasNext()) {
                break;
            }
            OnlCgformField next = it.next();
            if (oConvertUtils.isNotEmpty(next.getMainField())) {
                str = next.getDbFieldName();
                break;
            }
        }
        List<Map<String, Object>> querySubFormData = this.fieldService.querySubFormData(queryFormFields, table, str, mainId);
        if (querySubFormData != null && querySubFormData.size() == 0) {
            throw new DBException("数据库子表[" + table + "]未找到相关信息, 主表ID为" + mainId);
        }
        if (querySubFormData.size() > 1) {
            throw new DBException("数据库子表[" + table + "]存在多条记录, 主表ID为" + mainId);
        }
        return querySubFormData.get(0);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public List<Map<String, Object>> queryManySubFormData(String table, String mainId) throws DBException {
        OnlCgformHead onlCgformHead = getOne( new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, table));
        if (onlCgformHead == null) {
            throw new DBException("数据库子表[" + table + "]不存在");
        }
        List<OnlCgformField> queryFormFields = this.fieldService.queryFormFields(onlCgformHead.getId(), false);
        if (queryFormFields == null || queryFormFields.size() == 0) {
            throw new DBException("找不到子表字段，请确认配置是否正确!");
        }
        String str = null;
        String str2 = null;
        String str3 = null;
        Iterator<OnlCgformField> it = queryFormFields.iterator();
        while (true) {
            if (!it.hasNext()) {
                break;
            }
            OnlCgformField next = it.next();
            if (oConvertUtils.isNotEmpty(next.getMainField())) {
                str = next.getDbFieldName();
                str2 = next.getMainTable();
                str3 = next.getMainField();
                break;
            }
        }
        ArrayList arrayList = new ArrayList();
        OnlCgformField onlCgformField = new OnlCgformField();
        onlCgformField.setDbFieldName(str3);
        arrayList.add(onlCgformField);
        Map<String, Object> queryFormData = this.fieldService.queryFormData(arrayList, str2, mainId);
        List<Map<String, Object>> querySubFormData = this.fieldService.querySubFormData(queryFormFields, table, str, oConvertUtils.getString(oConvertUtils.getString(queryFormData.get(str3)), oConvertUtils.getString(queryFormData.get(str3.toUpperCase()))));
        if (querySubFormData != null && querySubFormData.size() == 0) {
            return Arrays.asList(new Map[0]);
        }
        ArrayList arrayList2 = new ArrayList(querySubFormData.size());
        for (Map<String, Object> map : querySubFormData) {
            arrayList2.add(CgformUtil.m361a(map));
        }
        return arrayList2;
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public Map<String, Object> queryManyFormData(String code, String id) throws DBException {
        String[] split;
        OnlCgformHead table = getTable(code);
        List<OnlCgformField> queryFormFields = this.fieldService.queryFormFields(table.getId(), true);
        if (queryFormFields == null || queryFormFields.size() == 0) {
            throw new DBException("找不到字段，请确认配置是否正确!");
        }
        Map<String, Object> queryFormData = this.fieldService.queryFormData(queryFormFields, CgformUtil.m317f(table.getTableName()), id);
        if (table.getTableType().intValue() == 2) {
            String subTableStr = table.getSubTableStr();
            if (oConvertUtils.isNotEmpty(subTableStr)) {
                for (String str : subTableStr.split(CgformUtil.f233E)) {
                    OnlCgformHead onlCgformHead = (this.baseMapper).selectOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, str));
                    if (onlCgformHead != null) {
                        List<OnlCgformField> queryFormFields2 = this.fieldService.queryFormFields(onlCgformHead.getId(), false);
                        String str2 = "";
                        String str3 = null;
                        for (OnlCgformField onlCgformField : queryFormFields2) {
                            if (!oConvertUtils.isEmpty(onlCgformField.getMainField())) {
                                str2 = onlCgformField.getDbFieldName();
                                str3 = CgformUtil.m360a(queryFormData, onlCgformField.getMainField());
                            }
                        }
                        List<Map<String, Object>> querySubFormData = this.fieldService.querySubFormData(queryFormFields2, str, str2, str3);
                        if (querySubFormData == null || querySubFormData.size() == 0) {
                            queryFormData.put(str, new String[0]);
                        } else {
                            queryFormData.put(str, CgformUtil.m322d(querySubFormData));
                        }
                    }
                }
            }
        }
        return queryFormData;
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    @Transactional(rollbackFor = {Exception.class})
    public String editManyFormData(String code, JSONObject json) throws DBException, BusinessException {
        String[] split;
        OnlCgformHead table = getTable(code);
        executeEnhanceJava(CgformConstant.f375j, CgformUtil.f274at, table, json);
        String tableName = table.getTableName();
        if ("Y".equals(table.getIsTree())) {
            this.fieldService.editTreeFormData(table.getId(), tableName, json, table.getTreeIdField(), table.getTreeParentIdField());
        } else {
            this.fieldService.editFormData(table.getId(), tableName, json, false);
        }
        if (table.getTableType().intValue() == 2) {
            String subTableStr = table.getSubTableStr();
            if (oConvertUtils.isNotEmpty(subTableStr)) {
                for (String str : subTableStr.split(CgformUtil.f233E)) {
                    OnlCgformHead onlCgformHead = ( this.baseMapper).selectOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, str));
                    if (onlCgformHead != null) {
                        List<OnlCgformField> list = this.fieldService.list(new LambdaQueryWrapper<OnlCgformField>().eq(OnlCgformField::getCgformHeadId, onlCgformHead.getId()));
                        String str2 = "";
                        String str3 = null;
                        for (OnlCgformField onlCgformField : list) {
                            if (!oConvertUtils.isEmpty(onlCgformField.getMainField())) {
                                str2 = onlCgformField.getDbFieldName();
                                String mainField = onlCgformField.getMainField();
                                if (json.get(mainField.toLowerCase()) != null) {
                                    str3 = json.getString(mainField.toLowerCase());
                                }
                                if (json.get(mainField.toUpperCase()) != null) {
                                    str3 = json.getString(mainField.toUpperCase());
                                }
                            }
                        }
                        if (!oConvertUtils.isEmpty(str3)) {
                            this.fieldService.deleteAutoList(str, str2, str3);
                            JSONArray jSONArray = json.getJSONArray(str);
                            if (jSONArray != null && jSONArray.size() != 0) {
                                for (int i = 0; i < jSONArray.size(); i++) {
                                    JSONObject jSONObject = jSONArray.getJSONObject(i);
                                    if (str3 != null) {
                                        jSONObject.put(str2, str3);
                                    }
                                    this.fieldService.saveFormData(list, str, jSONObject);
                                }
                            }
                        }
                    }
                }
            }
        }
        executeEnhanceJava(CgformConstant.f375j, "end", table, json);
        executeEnhanceSql(CgformConstant.f375j, table.getId(), json);
        return tableName;
    }

    /* renamed from: a */
    private OnlCgformEnhanceJava m209a(String str, String str2, String str3) {
    	LambdaQueryWrapper<OnlCgformEnhanceJava> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getActiveStatus, "1");
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getButtonCode, str);
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getEvent, str2);
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getCgformHeadId, str3);
        return  this.onlCgformEnhanceJavaMapper.selectOne(lambdaQueryWrapper);
    }

    /* renamed from: b */
    private Object m195b(String str, String str2, String str3) {
    	LambdaQueryWrapper<OnlCgformEnhanceJava> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getActiveStatus, "1");
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getButtonCode, str);
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getEvent, str2);
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getCgformHeadId, str3);
        return m204a( this.onlCgformEnhanceJavaMapper.selectOne(lambdaQueryWrapper));
    }

    /* renamed from: a */
    private void m214a(JSONObject jSONObject, Object obj, String str, OnlCgformEnhanceJava onlCgformEnhanceJava) throws BusinessException {
        if (obj != null && (obj instanceof CgformEnhanceJavaInter)) {
            ((CgformEnhanceJavaInter) obj).execute(str, jSONObject);
        } else if (obj != null && (obj instanceof CgformEnhanceHttpFormImpl)) {
            ((CgformEnhanceHttpFormImpl) obj).execute(str, jSONObject, onlCgformEnhanceJava);
        }
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void executeEnhanceJava(String buttonCode, String eventType, OnlCgformHead head, JSONObject json) throws BusinessException {
        OnlCgformEnhanceJava m209a = m209a(buttonCode, eventType, head.getId());
        m214a(json, m204a(m209a), head.getTableName(), m209a);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void executeEnhanceExport(OnlCgformHead head, List<Map<String, Object>> dataList) throws BusinessException {
        executeEnhanceList(head, "export", dataList);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public EnhanceDataEnum executeEnhanceImport(OnlCgformHead head, JSONObject json) throws BusinessException {
        Object m204a = m204a(m209a("import", CgformUtil.f274at, head.getId()));
        if (m204a != null && (m204a instanceof CgformEnhanceJavaImportInter)) {
            return ((CgformEnhanceJavaImportInter) m204a).execute(head.getTableName(), json);
        }
        return EnhanceDataEnum.INSERT;
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void executeEnhanceList(OnlCgformHead head, String buttonCode, List<Map<String, Object>> dataList) throws BusinessException {
    	LambdaQueryWrapper<OnlCgformEnhanceJava>  lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getActiveStatus, "1");
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getButtonCode, buttonCode);
        lambdaQueryWrapper.eq(OnlCgformEnhanceJava::getCgformHeadId, head.getId());
        List selectList = this.onlCgformEnhanceJavaMapper.selectList(lambdaQueryWrapper);
        if (selectList != null && selectList.size() > 0) {
            Object m204a = m204a((OnlCgformEnhanceJava) selectList.get(0));
            if (m204a != null && (m204a instanceof CgformEnhanceJavaListInter)) {
                ((CgformEnhanceJavaListInter) m204a).execute(head.getTableName(), dataList);
            } else if (m204a != null && (m204a instanceof CgformEnhanceHttpListImpl)) {
                ((CgformEnhanceHttpListImpl) m204a).execute(head.getTableName(), dataList, (OnlCgformEnhanceJava) selectList.get(0));
            }
        }
    }

    /* renamed from: a */
    private Object m204a(OnlCgformEnhanceJava onlCgformEnhanceJava) {
        if (onlCgformEnhanceJava != null) {
            String cgJavaType = onlCgformEnhanceJava.getCgJavaType();
            String cgJavaValue = onlCgformEnhanceJava.getCgJavaValue();
            if (oConvertUtils.isNotEmpty(cgJavaValue)) {
                Object obj = null;
                if ("class".equals(cgJavaType)) {
                    try {
                        obj = MyClassLoader.getClassByScn(cgJavaValue).newInstance();
                    } catch (IllegalAccessException e) {
                        f456a.error(e.getMessage(), e);
                    } catch (InstantiationException e2) {
                        f456a.error(e2.getMessage(), e2);
                    }
                } else if ("spring".equals(cgJavaType)) {
                    obj = SpringContextUtils.getBean(cgJavaValue);
                } else if ("http".equals(cgJavaType)) {
                    obj = m193b(onlCgformEnhanceJava);
                }
                return obj;
            }
            return null;
        }
        return null;
    }

    /* renamed from: b */
    private Object m193b(OnlCgformEnhanceJava onlCgformEnhanceJava) {
        String buttonCode = onlCgformEnhanceJava.getButtonCode();
        boolean z = true;
        switch (buttonCode) {
            case "delete":
            	return this.cgformEnhanceJavaHttp;
            case "export":
            	return this.cgformEnhanceJavaListHttp;
            case "import":
            	return this.cgformEnhanceJavaListHttp;
            case "add":
            	return this.cgformEnhanceJavaHttp;
            case "edit":
            	return this.cgformEnhanceJavaHttp;
            case "query":
            	 return this.cgformEnhanceJavaListHttp;
            default:
                return this.cgformEnhanceJavaHttp;
        }
    }

    /* renamed from: c */
    private OnlCgformEnhanceSql m191c(String str, String str2) {
    	LambdaQueryWrapper<OnlCgformEnhanceSql> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformEnhanceSql::getButtonCode, str);
        lambdaQueryWrapper.eq(OnlCgformEnhanceSql::getCgformHeadId, str2);
        return (OnlCgformEnhanceSql) this.onlCgformEnhanceSqlMapper.selectOne(lambdaQueryWrapper);
    }

    /* renamed from: a */
    private void m213a(JSONObject jSONObject, OnlCgformEnhanceSql onlCgformEnhanceSql) {
        String[] split;
        if (onlCgformEnhanceSql != null && oConvertUtils.isNotEmpty(onlCgformEnhanceSql.getCgbSql())) {
            for (String str : CgformUtil.m377a(onlCgformEnhanceSql.getCgbSql(), jSONObject).split(";")) {
                if (str != null && !"".equals(str.toLowerCase().trim())) {
                    ((OnlCgformHeadMapper) this.baseMapper).executeDDL(str);
                }
            }
        }
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void executeEnhanceSql(String buttonCode, String formId, JSONObject json) {
        m213a(json, m191c(buttonCode, formId));
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void executeCustomerButton(String buttonCode, String formId, String dataId) throws BusinessException {
        OnlCgformHead onlCgformHead = (OnlCgformHead) getById(formId);
        if (onlCgformHead == null) {
            throw new BusinessException("未找到表配置信息");
        }
        OnlCgformEnhanceJava m209a = m209a(buttonCode, CgformUtil.f274at, formId);
        OnlCgformEnhanceJava m209a2 = m209a(buttonCode, "end", formId);
        Object m204a = m204a(m209a);
        Object m204a2 = m204a(m209a2);
        OnlCgformEnhanceSql m191c = m191c(buttonCode, formId);
        String tableName = onlCgformHead.getTableName();
        String[] split = dataId.split(CgformUtil.f233E);
        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, formId);
        List list = this.onlCgformFieldService.list(lambdaQueryWrapper);
        for (String str : split) {
            JSONObject parseObject = JSONObject.parseObject(JSON.toJSONString(m205a(list, m190d(CgformUtil.m317f(onlCgformHead.getTableName()), CgformUtil.m309k(str)))));
            m214a(parseObject, m204a, tableName, m209a);
            m213a(parseObject, m191c);
            m214a(parseObject, m204a2, tableName, m209a2);
        }
    }

    /* renamed from: d */
    private Map<String, Object> m190d(String str, String str2) {
        return ((OnlCgformHeadMapper) this.baseMapper).queryOneByTableNameAndId(SqlInjectionUtil.getSqlInjectTableName(str), str2);
    }

    /* renamed from: a */
    private Map<String, Object> m205a(List<OnlCgformField> list, Map<String, Object> map) {
        HashMap hashMap = new HashMap(5);
        for (OnlCgformField onlCgformField : list) {
            String dbType = onlCgformField.getDbType();
            if (!"blob".equalsIgnoreCase(dbType) && !ExtendJsonKey.f133f.equalsIgnoreCase(dbType)) {
                String dbFieldName = onlCgformField.getDbFieldName();
                hashMap.put(dbFieldName, CgformUtil.m335b(map, dbFieldName));
            }
        }
        return hashMap;
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public List<OnlCgformButton> queryValidButtonList(String headId) {
    	LambdaQueryWrapper<OnlCgformButton> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformButton::getCgformHeadId, headId);
        lambdaQueryWrapper.eq(OnlCgformButton::getButtonStatus, "1");
        lambdaQueryWrapper.orderByAsc(OnlCgformButton::getOrderNum);
        return this.onlCgformButtonMapper.selectList(lambdaQueryWrapper);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public OnlCgformEnhanceJs queryEnhanceJs(String formId, String cgJsType) {
    	LambdaQueryWrapper<OnlCgformEnhanceJs> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformEnhanceJs::getCgformHeadId, formId);
        lambdaQueryWrapper.eq(OnlCgformEnhanceJs::getCgJsType, cgJsType);
        return (OnlCgformEnhanceJs) this.onlCgformEnhanceJsMapper.selectOne(lambdaQueryWrapper);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    @Transactional(rollbackFor = {Exception.class})
    public void deleteOneTableInfo(String formId, String dataId) throws BusinessException {
        OnlCgformHead onlCgformHead = (OnlCgformHead) getById(formId);
        if (onlCgformHead == null) {
            throw new BusinessException("未找到表配置信息");
        }
        String m317f = CgformUtil.m317f(onlCgformHead.getTableName());
        Map<String, Object> m190d = m190d(m317f, dataId);
        if (m190d == null) {
            return;
        }
        JSONObject parseObject = JSONObject.parseObject(JSON.toJSONString(CgformUtil.m361a(m190d)));
        executeEnhanceJava(CgformConstant.f376k, CgformUtil.f274at, onlCgformHead, parseObject);
        updateParentNode(onlCgformHead, dataId);
        if (onlCgformHead.getTableType().intValue() == 2) {
            this.fieldService.deleteAutoListMainAndSub(onlCgformHead, dataId);
        } else {
            ((OnlCgformHeadMapper) this.baseMapper).deleteOne(SqlInjectionUtil.getSqlInjectTableName(m317f), dataId);
        }
        executeEnhanceSql(CgformConstant.f376k, formId, parseObject);
        executeEnhanceJava(CgformConstant.f376k, "end", onlCgformHead, parseObject);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    @Deprecated
    public JSONObject queryFormItem(OnlCgformHead head, String username) {
        List<String> queryFormDisabledCode;
        List<OnlCgformField> queryAvailableFields = this.fieldService.queryAvailableFields(head.getId(), head.getTableName(), head.getTaskId(), false);
        ArrayList arrayList = new ArrayList();
        if (oConvertUtils.isEmpty(head.getTaskId())) {
            List<String> queryFormDisabledCode2 = this.onlAuthPageService.queryFormDisabledCode(head.getId());
            if (queryFormDisabledCode2 != null && queryFormDisabledCode2.size() > 0 && queryFormDisabledCode2.get(0) != null) {
                arrayList.addAll(queryFormDisabledCode2);
            }
        } else {
            List<String> queryDisabledFields = this.fieldService.queryDisabledFields(head.getTableName(), head.getTaskId());
            if (queryDisabledFields != null && queryDisabledFields.size() > 0 && queryDisabledFields.get(0) != null) {
                arrayList.addAll(queryDisabledFields);
            }
        }
        JSONObject m362a = CgformUtil.m362a(queryAvailableFields, arrayList, (TreeSelectColumn) null);
        if (head.getTableType().intValue() == 2) {
            String subTableStr = head.getSubTableStr();
            if (oConvertUtils.isNotEmpty(subTableStr)) {
                for (String str : subTableStr.split(CgformUtil.f233E)) {
                    OnlCgformHead onlCgformHead = (this.baseMapper).selectOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, str));
                    if (onlCgformHead != null) {
                        List<OnlCgformField> queryAvailableFields2 = this.fieldService.queryAvailableFields(onlCgformHead.getId(), onlCgformHead.getTableName(), head.getTaskId(), false);
                        if (oConvertUtils.isNotEmpty(head.getTaskId())) {
                            queryFormDisabledCode = this.fieldService.queryDisabledFields(onlCgformHead.getTableName(), head.getTaskId());
                        } else {
                            queryFormDisabledCode = this.onlAuthPageService.queryFormDisabledCode(onlCgformHead.getId());
                        }
                        JSONObject jSONObject = new JSONObject();
                        if (1 == onlCgformHead.getRelationType().intValue()) {
                            jSONObject = CgformUtil.m362a(queryAvailableFields2, queryFormDisabledCode, (TreeSelectColumn) null);
                        } else {
                            jSONObject.put("columns", CgformUtil.m363a(queryAvailableFields2, queryFormDisabledCode));
                        }
                        jSONObject.put("relationType", onlCgformHead.getRelationType());
                        jSONObject.put(CgformUtil.view, "tab");
                        jSONObject.put("order", onlCgformHead.getTabOrderNum());
                        jSONObject.put("formTemplate", onlCgformHead.getFormTemplate());
                        jSONObject.put("describe", onlCgformHead.getTableTxt());
                        jSONObject.put("key", onlCgformHead.getTableName());
                        m362a.getJSONObject(CgformUtil.properties).put(onlCgformHead.getTableName(), jSONObject);
                    }
                }
            }
        }
        return m362a;
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public List<String> generateCode(OnlGenerateModel model) throws Exception {
        TableVo tableVo = new TableVo();
        tableVo.setEntityName(model.getEntityName());
        tableVo.setEntityPackage(model.getEntityPackage());
        tableVo.setFtlDescription(model.getFtlDescription());
        tableVo.setTableName(model.getTableName());
        tableVo.setSearchFieldNum(-1);
        ArrayList arrayList = new ArrayList();
        ArrayList arrayList2 = new ArrayList();
        m208a(model.getCode(), arrayList, arrayList2);
        OnlCgformHead onlCgformHead =  (this.baseMapper).selectOne( new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getId, model.getCode()));
        HashMap hashMap = new HashMap(5);
        hashMap.put("scroll", onlCgformHead.getScroll() == null ? CgformUtil.f304aX : onlCgformHead.getScroll().toString());
        String formTemplate = onlCgformHead.getFormTemplate();
        if (oConvertUtils.isEmpty(formTemplate)) {
            tableVo.setFieldRowNum(1);
        } else {
            tableVo.setFieldRowNum(Integer.valueOf(Integer.parseInt(formTemplate)));
        }
        if ("Y".equals(onlCgformHead.getIsTree())) {
            hashMap.put("pidField", onlCgformHead.getTreeParentIdField());
            hashMap.put("hasChildren", onlCgformHead.getTreeIdField());
            hashMap.put(ExtendJsonKey.f137j, onlCgformHead.getTreeFieldname());
        }
        if (oConvertUtils.isNotEmpty(model.getVueStyle())) {
            hashMap.put("vueStyle", model.getVueStyle());
        }
        tableVo.setExtendParams(hashMap);
        CgformEnum cgformEnumByConfig = CgformEnum.getCgformEnumByConfig(model.getJspMode());
        List generateCodeFile = new CodeGenerateOne(tableVo, arrayList, arrayList2).generateCodeFile(model.getProjectPath(), cgformEnumByConfig.getTemplatePath(), cgformEnumByConfig.getStylePath());
        if (generateCodeFile == null || generateCodeFile.size() == 0) {
            generateCodeFile = new ArrayList();
            generateCodeFile.add(" :::::: 生成失败ERROR提示 :::::: ");
            generateCodeFile.add("1.代码生成模板`code-template-online`目录是否存在");
            generateCodeFile.add("2.代码生成模板`code-template-online`目录是否含有中文或空格");
        }
        return generateCodeFile;
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public List<String> generateOneToMany(OnlGenerateModel model) throws Exception {
        MainTableVo mainTableVo = new MainTableVo();
        mainTableVo.setEntityName(model.getEntityName());
        mainTableVo.setEntityPackage(model.getEntityPackage());
        mainTableVo.setFtlDescription(model.getFtlDescription());
        mainTableVo.setTableName(model.getTableName());
        String formTemplate = (this.baseMapper.selectOne( new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getId, model.getCode()))).getFormTemplate();
        if (oConvertUtils.isEmpty(formTemplate)) {
            mainTableVo.setFieldRowNum(1);
        } else {
            mainTableVo.setFieldRowNum(Integer.valueOf(Integer.parseInt(formTemplate)));
        }
        ArrayList arrayList = new ArrayList();
        ArrayList arrayList2 = new ArrayList();
        m208a(model.getCode(), arrayList, arrayList2);
        List<OnlGenerateModel> subList = model.getSubList();
        ArrayList arrayList3 = new ArrayList();
        for (OnlGenerateModel onlGenerateModel : subList) {
            OnlCgformHead onlCgformHead = this.baseMapper.selectOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, onlGenerateModel.getTableName()));
            if (onlCgformHead != null) {
                SubTableVo subTableVo = new SubTableVo();
                subTableVo.setEntityName(onlGenerateModel.getEntityName());
                subTableVo.setEntityPackage(model.getEntityPackage());
                subTableVo.setTableName(onlGenerateModel.getTableName());
                subTableVo.setFtlDescription(onlGenerateModel.getFtlDescription());
                subTableVo.setForeignRelationType(onlCgformHead.getRelationType().intValue() == 1 ? "1" : CgformUtil.f304aX);
                ArrayList arrayList4 = new ArrayList();
                ArrayList arrayList5 = new ArrayList();
                OnlCgformField m208a = m208a(onlCgformHead.getId(), arrayList4, arrayList5);
                if (m208a != null) {
                    subTableVo.setOriginalForeignKeys(new String[]{m208a.getDbFieldName()});
                    subTableVo.setForeignKeys(new String[]{m208a.getDbFieldName()});
                    subTableVo.setForeignMainKeys(new String[]{m208a.getMainField()});
                    subTableVo.setColums(arrayList4);
                    subTableVo.setOriginalColumns(arrayList5);
                    arrayList3.add(subTableVo);
                }
            }
        }
        CgformEnum cgformEnumByConfig = CgformEnum.getCgformEnumByConfig(model.getJspMode());
        if (oConvertUtils.isNotEmpty(model.getVueStyle())) {
            List asList = Arrays.asList(cgformEnumByConfig.getVueStyle());
            HashMap hashMap = new HashMap(5);
            if (asList.contains(model.getVueStyle())) {
                hashMap.put("vueStyle", model.getVueStyle());
            } else {
                f456a.warn("你选择的页面代码类型：【" + model.getVueStyle() + "】不支持，采用默认类型:" + ((String) asList.get(0)) + "生成代码！");
                hashMap.put("vueStyle", asList.get(0));
            }
            mainTableVo.setExtendParams(hashMap);
        }
        if (arrayList3 == null || arrayList3.size() == 0) {
            f456a.error("你选择的表类型是【主表】，但是没有关联子表，导致生成代码报错！");
            throw new TuringBootException("你选择的表类型是【主表】，但是没有关联子表，生成代码失败！");
        }
        return new CodeGenerateOneToMany(mainTableVo, arrayList, arrayList2, arrayList3).generateCodeFile(model.getProjectPath(), cgformEnumByConfig.getTemplatePath(), cgformEnumByConfig.getStylePath());
    }

    /* renamed from: a */
    private OnlCgformField m208a(String str, List<ColumnVo> list, List<ColumnVo> list2) {
    	LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, str);
        lambdaQueryWrapper.eq(OnlCgformField::getDbIsPersist, OnlineConst.f140b);
        lambdaQueryWrapper.orderByAsc(OnlCgformField::getOrderNum);
        OnlCgformField onlCgformField = null;
        for (OnlCgformField onlCgformField2 : this.fieldService.list(lambdaQueryWrapper)) {
            if (oConvertUtils.isNotEmpty(onlCgformField2.getMainTable())) {
                onlCgformField = onlCgformField2;
            }
            ColumnVo columnVo = new ColumnVo();
            columnVo.setFieldLength(onlCgformField2.getFieldLength());
            columnVo.setFieldHref(onlCgformField2.getFieldHref());
            columnVo.setFieldValidType(onlCgformField2.getFieldValidType());
            columnVo.setFieldDefault(onlCgformField2.getDbDefaultVal());
            columnVo.setFieldShowType(onlCgformField2.getFieldShowType());
            columnVo.setFieldOrderNum(onlCgformField2.getOrderNum());
            columnVo.setIsKey(onlCgformField2.getDbIsKey().intValue() == 1 ? "Y" : "N");
            columnVo.setIsShow(onlCgformField2.getIsShowForm().intValue() == 1 ? "Y" : "N");
            columnVo.setIsShowList(onlCgformField2.getIsShowList().intValue() == 1 ? "Y" : "N");
            columnVo.setIsQuery(onlCgformField2.getIsQuery().intValue() == 1 ? "Y" : "N");
            columnVo.setQueryMode(onlCgformField2.getQueryMode());
            columnVo.setDictField(onlCgformField2.getDictField());
            columnVo.setDictTable(onlCgformField2.getDictTable());
            columnVo.setDictText(onlCgformField2.getDictText());
            columnVo.setFieldDbName(onlCgformField2.getDbFieldName());
            columnVo.setFieldName(oConvertUtils.camelName(onlCgformField2.getDbFieldName()));
            columnVo.setFiledComment(onlCgformField2.getDbFieldTxt());
            columnVo.setFieldDbType(onlCgformField2.getDbType());
            columnVo.setFieldType(m197b(onlCgformField2.getDbType()));
            columnVo.setClassType(onlCgformField2.getFieldShowType());
            columnVo.setClassType_row(onlCgformField2.getFieldShowType());
            if (onlCgformField2.getDbIsNull().intValue() == 0 || "*".equals(onlCgformField2.getFieldValidType()) || "1".equals(onlCgformField2.getFieldMustInput())) {
                columnVo.setNullable("N");
            } else {
                columnVo.setNullable("Y");
            }
            if (CgformUtil.f240L.equals(onlCgformField2.getFieldShowType())) {
                if (oConvertUtils.isNotEmpty(onlCgformField2.getFieldExtendJson())) {
                    JSONArray parseArray = JSONArray.parseArray("[\"Y\",\"N\"]");
                    try {
                        parseArray = JSONArray.parseArray(onlCgformField2.getFieldExtendJson());
                    } catch (JSONException e) {
                        JSONObject parseObject = JSONArray.parseObject(onlCgformField2.getFieldExtendJson());
                        if (parseObject.containsKey(CgformUtil.f302aV)) {
                            parseArray = parseObject.getJSONArray(CgformUtil.f302aV);
                        }
                    }
                    columnVo.setDictField(JSON.toJSONString(parseArray, new SerializerFeature[]{SerializerFeature.UseSingleQuotes}));
                } else {
                    columnVo.setDictField("is_open");
                }
            }
            HashMap hashMap = new HashMap(5);
            if (StringUtils.isNotBlank(onlCgformField2.getFieldExtendJson())) {
                try {
                    JSONObject parseObject2 = JSONObject.parseObject(onlCgformField2.getFieldExtendJson());
                    if (parseObject2 != null) {
                        hashMap.putAll(parseObject2.getInnerMap());
                    }
                } catch (JSONException e2) {
                }
            }
            columnVo.setExtendParams(hashMap);
            if (!hashMap.isEmpty() && hashMap.containsKey("picker")) {
                String str2 = (String) hashMap.get("picker");
                if (oConvertUtils.isNotEmpty(str2)) {
                    if (str2.trim().equalsIgnoreCase("default")) {
                        hashMap.remove("picker");
                    } else if ("date".equalsIgnoreCase(onlCgformField2.getFieldShowType()) && oConvertUtils.isNotEmpty(onlCgformField2.getFieldDefaultValue())) {
                        onlCgformField2.setFieldDefaultValue(new DateFormatConverter(onlCgformField2).converterToVal(onlCgformField2.getFieldDefaultValue()));
                    }
                }
            }
            if (CgformUtil.f241M.equals(onlCgformField2.getFieldShowType()) || CgformUtil.f242N.equals(onlCgformField2.getFieldShowType())) {
                boolean z = true;
                Object obj = hashMap.get(ExtendJsonKey.f130c);
                if (obj != null) {
                    z = ((Boolean) obj).booleanValue();
                }
                hashMap.put(ExtendJsonKey.f130c, Boolean.valueOf(z));
            }
            columnVo.setSort("1".equals(onlCgformField2.getSortFlag()) ? "Y" : "N");
            Integer num = 1;
            columnVo.setReadonly(num.equals(onlCgformField2.getIsReadOnly()) ? "Y" : "N");
            if (oConvertUtils.isNotEmpty(onlCgformField2.getFieldDefaultValue()) && !onlCgformField2.getFieldDefaultValue().trim().startsWith("${") && !onlCgformField2.getFieldDefaultValue().trim().startsWith("#{") && !onlCgformField2.getFieldDefaultValue().trim().startsWith("{{")) {
                columnVo.setDefaultVal(onlCgformField2.getFieldDefaultValue());
            }
            if (("file".equals(onlCgformField2.getFieldShowType()) || "image".equals(onlCgformField2.getFieldShowType())) && oConvertUtils.isNotEmpty(onlCgformField2.getFieldExtendJson())) {
                JSONObject parseObject3 = JSONObject.parseObject(onlCgformField2.getFieldExtendJson());
                if (oConvertUtils.isNotEmpty(parseObject3.getString(ExtendJsonKey.f128a))) {
                    columnVo.setUploadnum(parseObject3.getString(ExtendJsonKey.f128a));
                }
            }
            list2.add(columnVo);
            if (onlCgformField2.getIsShowForm().intValue() == 1 || onlCgformField2.getIsShowList().intValue() == 1 || onlCgformField2.getIsQuery().intValue() == 1) {
                list.add(columnVo);
            }
        }
        return onlCgformField;
    }

    /* renamed from: b */
    private String m197b(String str) {
        String lowerCase = str.toLowerCase();
        if (lowerCase.indexOf("int") >= 0) {
            return "java.lang.Integer";
        }
        if (lowerCase.indexOf("double") >= 0) {
            return "java.lang.Double";
        }
        if (lowerCase.indexOf(DataBaseConst.f574e) >= 0) {
            return "java.math.BigDecimal";
        }
        if (lowerCase.indexOf("date") >= 0) {
            return "java.util.Date";
        }
        return "java.lang.String";
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void addCrazyFormData(String tbname, JSONObject json) throws DBException, UnsupportedEncodingException {
        String subTableStr;
        String[] split;
        OnlCgformHead onlCgformHead;
        OnlCgformHead onlCgformHead2 = getOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, tbname));
        if (onlCgformHead2 == null) {
            throw new DBException("数据库主表[" + tbname + "]不存在");
        }
        if (onlCgformHead2.getTableType().intValue() == 2 && (subTableStr = onlCgformHead2.getSubTableStr()) != null) {
            for (String str : subTableStr.split(CgformUtil.f233E)) {
                JSONArray m211a = m211a(str, json);
                if (!CollectionUtils.isEmpty(m211a) && (onlCgformHead = this.baseMapper.selectOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, str))) != null) {
                    List<OnlCgformField> list = this.fieldService.list( new LambdaQueryWrapper<OnlCgformField>().eq(OnlCgformField::getCgformHeadId, onlCgformHead.getId()));
                    String str2 = "";
                    String str3 = null;
                    for (OnlCgformField onlCgformField : list) {
                        if (!oConvertUtils.isEmpty(onlCgformField.getMainField())) {
                            str2 = onlCgformField.getDbFieldName();
                            str3 = json.getString(onlCgformField.getMainField());
                        }
                    }
                    for (int i = 0; i < m211a.size(); i++) {
                        JSONObject jSONObject = m211a.getJSONObject(i);
                        if (str3 != null) {
                            jSONObject.put(str2, str3);
                        }
                        this.fieldService.executeInsertSQL(CgformUtil.m330c(str, list, jSONObject));
                    }
                }
            }
        }
        this.fieldService.saveFormData(onlCgformHead2.getId(), tbname, json, true);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void editCrazyFormData(String tbname, JSONObject json) throws DBException, UnsupportedEncodingException {
        String[] split;
        OnlCgformHead onlCgformHead = getOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, tbname));
        if (onlCgformHead == null) {
            throw new DBException("数据库主表[" + tbname + "]不存在");
        }
        if (onlCgformHead.getTableType().intValue() == 2) {
            String subTableStr = onlCgformHead.getSubTableStr();
            if (oConvertUtils.isNotEmpty(subTableStr)) {
                for (String str : subTableStr.split(CgformUtil.f233E)) {
                    OnlCgformHead onlCgformHead2 = ( this.baseMapper).selectOne( new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, str));
                    if (onlCgformHead2 != null) {
                        List<OnlCgformField> list = this.fieldService.list( new LambdaQueryWrapper<OnlCgformField>().eq(OnlCgformField::getCgformHeadId, onlCgformHead2.getId()));
                        String str2 = "";
                        String str3 = null;
                        for (OnlCgformField onlCgformField : list) {
                            if (!oConvertUtils.isEmpty(onlCgformField.getMainField())) {
                                str2 = onlCgformField.getDbFieldName();
                                str3 = json.getString(onlCgformField.getMainField());
                            }
                        }
                        if (!oConvertUtils.isEmpty(str3)) {
                            this.fieldService.deleteAutoList(str, str2, str3);
                            JSONArray m211a = m211a(str, json);
                            if (!CollectionUtils.isEmpty(m211a)) {
                                for (int i = 0; i < m211a.size(); i++) {
                                    JSONObject jSONObject = m211a.getJSONObject(i);
                                    if (str3 != null) {
                                        jSONObject.put(str2, str3);
                                    }
                                    this.fieldService.executeInsertSQL(CgformUtil.m330c(str, list, jSONObject));
                                }
                            }
                        }
                    }
                }
            }
        }
        this.fieldService.editFormData(onlCgformHead.getId(), tbname, json, true);
    }

    /* renamed from: a */
    private JSONArray m211a(String str, JSONObject jSONObject) {
        try {
            JSONArray jSONArray = jSONObject.getJSONArray(CgformUtil.f265ak + str);
            if (CollectionUtils.isEmpty(jSONArray)) {
                JSONArray jSONArray2 = jSONObject.getJSONArray(CgformUtil.f266al + str);
                if (CollectionUtils.isEmpty(jSONArray2)) {
                    return jSONObject.getJSONArray(CgformUtil.f267am + str);
                }
                return jSONArray2;
            }
            return jSONArray;
        } catch (Exception e) {
            f456a.error("表单设计器同步到Online，输入的子表数据不合法，已忽略", e);
            return null;
        }
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public Integer getMaxCopyVersion(String physicId) {
        Integer maxCopyVersion = ((OnlCgformHeadMapper) this.baseMapper).getMaxCopyVersion(physicId);
        return Integer.valueOf(maxCopyVersion == null ? 0 : maxCopyVersion.intValue());
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void copyOnlineTableConfig(OnlCgformHead physicTable) throws Exception {
        String id = physicTable.getId();
        OnlCgformHead onlCgformHead = new OnlCgformHead();
        String generate = UUIDGenerator.generate();
        onlCgformHead.setId(generate);
        onlCgformHead.setPhysicId(id);
        onlCgformHead.setCopyType(1);
        onlCgformHead.setCopyVersion(physicTable.getTableVersion());
        onlCgformHead.setTableVersion(1);
        onlCgformHead.setTableName(m189e(id, physicTable.getTableName()));
        onlCgformHead.setTableTxt(physicTable.getTableTxt());
        onlCgformHead.setFormCategory(physicTable.getFormCategory());
        onlCgformHead.setFormTemplate(physicTable.getFormTemplate());
        onlCgformHead.setFormTemplateMobile(physicTable.getFormTemplateMobile());
        onlCgformHead.setIdSequence(physicTable.getIdSequence());
        onlCgformHead.setIdType(physicTable.getIdType());
        onlCgformHead.setIsCheckbox(physicTable.getIsCheckbox());
        onlCgformHead.setIsPage(physicTable.getIsPage());
        onlCgformHead.setIsTree(physicTable.getIsTree());
        onlCgformHead.setQueryMode(physicTable.getQueryMode());
        onlCgformHead.setTableType(1);
        onlCgformHead.setIsDbSynch("N");
        onlCgformHead.setIsDesForm(physicTable.getIsDesForm());
        onlCgformHead.setDesFormCode(physicTable.getDesFormCode());
        onlCgformHead.setTreeParentIdField(physicTable.getTreeParentIdField());
        onlCgformHead.setTreeFieldname(physicTable.getTreeFieldname());
        onlCgformHead.setTreeIdField(physicTable.getTreeIdField());
        onlCgformHead.setRelationType(null);
        onlCgformHead.setTabOrderNum(null);
        onlCgformHead.setSubTableStr(null);
        onlCgformHead.setThemeTemplate(physicTable.getThemeTemplate());
        onlCgformHead.setScroll(physicTable.getScroll());
        onlCgformHead.setExtConfigJson(physicTable.getExtConfigJson());
        for (OnlCgformField onlCgformField : this.fieldService.list( new LambdaQueryWrapper<OnlCgformField>().eq(OnlCgformField::getCgformHeadId, id))) {
            OnlCgformField onlCgformField2 = new OnlCgformField();
            onlCgformField2.setCgformHeadId(generate);
            m202a(onlCgformField, onlCgformField2);
            this.fieldService.save(onlCgformField2);
        }
        ((OnlCgformHeadMapper) this.baseMapper).insert(onlCgformHead);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void initCopyState(List<OnlCgformHead> headList) {
        List<String> queryCopyPhysicId = ((OnlCgformHeadMapper) this.baseMapper).queryCopyPhysicId();
        for (OnlCgformHead onlCgformHead : headList) {
            if (queryCopyPhysicId.contains(onlCgformHead.getId())) {
                onlCgformHead.setHascopy(1);
            } else {
                onlCgformHead.setHascopy(0);
            }
        }
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void deleteBatch(String ids, String flag) {
        String[] split = ids.split(CgformUtil.f233E);
        if ("1".equals(flag)) {
            for (String str : split) {
                try {
                    deleteRecordAndTable(str);
                } catch (SQLException e) {
                    e.printStackTrace();
                } catch (DBException e2) {
                    e2.printStackTrace();
                }
            }
            return;
        }
        removeByIds(Arrays.asList(split));
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public void updateParentNode(OnlCgformHead head, String dataId) {
        if ("Y".equals(head.getIsTree())) {
            String m317f = CgformUtil.m317f(head.getTableName());
            String treeParentIdField = head.getTreeParentIdField();
            Map<String, Object> m190d = m190d(m317f, dataId);
            String str = null;
            if (m190d.get(treeParentIdField) != null && !CgformUtil.f304aX.equals(m190d.get(treeParentIdField))) {
                str = m190d.get(treeParentIdField).toString();
            } else if (m190d.get(treeParentIdField.toUpperCase()) != null && !CgformUtil.f304aX.equals(m190d.get(treeParentIdField.toUpperCase()))) {
                str = m190d.get(treeParentIdField.toUpperCase()).toString();
            }
            if (str != null && ((OnlCgformHeadMapper) this.baseMapper).queryChildNode(m317f, treeParentIdField, str).intValue() == 1) {
                this.fieldService.updateTreeNodeNoChild(m317f, head.getTreeIdField(), str);
            }
        }
    }

    /* renamed from: b */
    private void m192b(OnlCgformHead onlCgformHead, List<OnlCgformField> list) {
        List<OnlCgformHead> list2 = list( new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getPhysicId, onlCgformHead.getId()));
        if (list2 != null && list2.size() > 0) {
            for (OnlCgformHead onlCgformHead2 : list2) {
                List<OnlCgformField> list3 = this.fieldService.list(new LambdaQueryWrapper<OnlCgformField>().eq(OnlCgformField::getCgformHeadId, onlCgformHead2.getId()));
                if (list3 == null || list3.size() == 0) {
                    for (OnlCgformField onlCgformField : list) {
                        OnlCgformField onlCgformField2 = new OnlCgformField();
                        onlCgformField2.setCgformHeadId(onlCgformHead2.getId());
                        m202a(onlCgformField, onlCgformField2);
                        this.fieldService.save(onlCgformField2);
                    }
                } else {
                    Map<String,Integer> hashMap = new HashMap(5);
                    for (OnlCgformField onlCgformField3 : list3) {
                        hashMap.put(onlCgformField3.getDbFieldName(), 1);
                    }
                    Map<String,Integer> hashMap2 = new HashMap(5);
                    for (OnlCgformField onlCgformField4 : list) {
                        hashMap2.put(onlCgformField4.getDbFieldName(), 1);
                    }
                    ArrayList<String> arrayList = new ArrayList();
                    ArrayList arrayList2 = new ArrayList();
                    for (String str : hashMap2.keySet()) {
                        if (hashMap.get(str) == null) {
                            arrayList2.add(str);
                        } else {
                            arrayList.add(str);
                        }
                    }
                    ArrayList arrayList3 = new ArrayList();
                    for (String str2 : hashMap.keySet()) {
                        if (hashMap2.get(str2) == null) {
                            arrayList3.add(str2);
                        }
                    }
                    if (arrayList3.size() > 0) {
                        for (OnlCgformField onlCgformField5 : list3) {
                            if (arrayList3.contains(onlCgformField5.getDbFieldName())) {
                                this.fieldService.removeById(onlCgformField5.getId());
                            }
                        }
                    }
                    if (arrayList2.size() > 0) {
                        for (OnlCgformField onlCgformField6 : list) {
                            if (arrayList2.contains(onlCgformField6.getDbFieldName())) {
                                OnlCgformField onlCgformField7 = new OnlCgformField();
                                onlCgformField7.setCgformHeadId(onlCgformHead2.getId());
                                m202a(onlCgformField6, onlCgformField7);
                                this.fieldService.save(onlCgformField7);
                            }
                        }
                    }
                    if (arrayList.size() > 0) {
                        for (String str3 : arrayList) {
                            m194b(str3, list, list3);
                        }
                    }
                }
            }
        }
    }

    /* renamed from: b */
    private void m194b(String str, List<OnlCgformField> list, List<OnlCgformField> list2) {
        OnlCgformField onlCgformField = null;
        for (OnlCgformField onlCgformField2 : list) {
            if (str.equals(onlCgformField2.getDbFieldName())) {
                onlCgformField = onlCgformField2;
            }
        }
        OnlCgformField onlCgformField3 = null;
        for (OnlCgformField onlCgformField4 : list2) {
            if (str.equals(onlCgformField4.getDbFieldName())) {
                onlCgformField3 = onlCgformField4;
            }
        }
        if (onlCgformField != null && onlCgformField3 != null) {
            boolean z = false;
            if (!onlCgformField.getDbType().equals(onlCgformField3.getDbType())) {
                onlCgformField3.setDbType(onlCgformField.getDbType());
                z = true;
            }
            if (onlCgformField.getDbDefaultVal() != null && !onlCgformField.getDbDefaultVal().equals(onlCgformField3.getDbDefaultVal())) {
                onlCgformField3.setDbDefaultVal(onlCgformField.getDbDefaultVal());
                z = true;
            }
            if (!onlCgformField.getDbLength().equals(onlCgformField3.getDbLength())) {
                onlCgformField3.setDbLength(onlCgformField.getDbLength());
                z = true;
            }
            if (onlCgformField.getDbIsNull() != onlCgformField3.getDbIsNull()) {
                onlCgformField3.setDbIsNull(onlCgformField.getDbIsNull());
                z = true;
            }
            if (z) {
                this.fieldService.updateById(onlCgformField3);
            }
        }
    }

    /* renamed from: a */
    private void m202a(OnlCgformField onlCgformField, OnlCgformField onlCgformField2) {
        onlCgformField2.setDbDefaultVal(onlCgformField.getDbDefaultVal());
        onlCgformField2.setDbFieldName(onlCgformField.getDbFieldName());
        onlCgformField2.setDbFieldNameOld(onlCgformField.getDbFieldNameOld());
        onlCgformField2.setDbFieldTxt(onlCgformField.getDbFieldTxt());
        onlCgformField2.setDbIsKey(onlCgformField.getDbIsKey());
        onlCgformField2.setDbIsNull(onlCgformField.getDbIsNull());
        onlCgformField2.setDbLength(onlCgformField.getDbLength());
        onlCgformField2.setDbPointLength(onlCgformField.getDbPointLength());
        onlCgformField2.setDbType(onlCgformField.getDbType());
        onlCgformField2.setDictField(onlCgformField.getDictField());
        onlCgformField2.setDictTable(onlCgformField.getDictTable());
        onlCgformField2.setDictText(onlCgformField.getDictText());
        onlCgformField2.setFieldExtendJson(onlCgformField.getFieldExtendJson());
        onlCgformField2.setFieldHref(onlCgformField.getFieldHref());
        onlCgformField2.setFieldLength(onlCgformField.getFieldLength());
        onlCgformField2.setFieldMustInput(onlCgformField.getFieldMustInput());
        onlCgformField2.setFieldShowType(onlCgformField.getFieldShowType());
        onlCgformField2.setFieldValidType(onlCgformField.getFieldValidType());
        onlCgformField2.setFieldDefaultValue(onlCgformField.getFieldDefaultValue());
        onlCgformField2.setIsQuery(onlCgformField.getIsQuery());
        onlCgformField2.setIsShowForm(onlCgformField.getIsShowForm());
        onlCgformField2.setIsShowList(onlCgformField.getIsShowList());
        onlCgformField2.setMainField(onlCgformField.getMainField());
        onlCgformField2.setMainTable(onlCgformField.getMainTable());
        onlCgformField2.setOrderNum(onlCgformField.getOrderNum());
        onlCgformField2.setQueryMode(onlCgformField.getQueryMode());
        onlCgformField2.setIsReadOnly(onlCgformField.getIsReadOnly());
        onlCgformField2.setSortFlag(onlCgformField.getSortFlag());
        onlCgformField2.setQueryDefVal(onlCgformField.getQueryDefVal());
        onlCgformField2.setQueryConfigFlag(onlCgformField.getQueryConfigFlag());
        onlCgformField2.setQueryDictField(onlCgformField.getQueryDictField());
        onlCgformField2.setQueryDictTable(onlCgformField.getQueryDictTable());
        onlCgformField2.setQueryDictText(onlCgformField.getQueryDictText());
        onlCgformField2.setQueryMustInput(onlCgformField.getQueryMustInput());
        onlCgformField2.setQueryShowType(onlCgformField.getQueryShowType());
        onlCgformField2.setQueryValidType(onlCgformField.getQueryValidType());
        onlCgformField2.setConverter(onlCgformField.getConverter());
        onlCgformField2.setDbIsPersist(onlCgformField.getDbIsPersist());
    }

    /* renamed from: a */
    private void m203a(OnlCgformField onlCgformField) {
        if (DataBaseConst.f579j.equals(onlCgformField.getDbType()) || "Blob".equals(onlCgformField.getDbType())) {
            onlCgformField.setDbLength(0);
            onlCgformField.setDbPointLength(0);
        }
    }

    /* renamed from: e */
    private String m189e(String str, String str2) {
        List<String> queryAllCopyTableName = ((OnlCgformHeadMapper) this.baseMapper).queryAllCopyTableName(str);
        int i = 0;
        if (queryAllCopyTableName != null || queryAllCopyTableName.size() > 0) {
            for (int i2 = 0; i2 < queryAllCopyTableName.size(); i2++) {
                int parseInt = Integer.parseInt(queryAllCopyTableName.get(i2).split("\\$")[1]);
                if (parseInt > i) {
                    i = parseInt;
                }
            }
        }
        return str2 + CgformUtil.f224v + (i + 1);
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    @Transactional(rollbackFor = {Exception.class})
    public String deleteDataByCode(String cgformCode, String dataIds) {
        OnlCgformHead onlCgformHead = super.getOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, cgformCode));
        if (onlCgformHead == null) {
            throw new TuringBootException("实体不存在");
        }
        String tableName = onlCgformHead.getTableName();
        try {
            if (dataIds.indexOf(CgformUtil.f233E) > 0) {
                this.onlCgformFieldService.deleteAutoListById(tableName, dataIds);
            } else {
                deleteOneTableInfo(onlCgformHead.getId(), dataIds);
            }
            return tableName;
        } catch (Exception e) {
            f456a.error("OnlCgformApiController.formEdit()发生异常：" + e.getMessage(), e);
            throw new TuringBootException("删除失败：" + e.getMessage());
        }
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public JSONObject queryAllDataByTableNameForDesform(String tableName, String dataIds) throws DBException {
        JSONObject jSONObject = new JSONObject();
        LambdaQueryWrapper<OnlCgformHead> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformHead::getTableName, tableName);
        OnlCgformHead onlCgformHead = super.getOne(lambdaQueryWrapper);
        if (onlCgformHead == null) {
            throw new TuringBootException("表单数据不存在！");
        }
        Map<String, Object> queryManyFormData = queryManyFormData(onlCgformHead.getId(), dataIds);
        if (queryManyFormData == null) {
            throw new TuringBootException("表单数据查询失败！");
        }
        JSONObject parseObject = JSON.parseObject(JSON.toJSONString(queryManyFormData));
        String subTableStr = onlCgformHead.getSubTableStr();
        if (oConvertUtils.isNotEmpty(subTableStr)) {
            ArrayList arrayList = new ArrayList(Arrays.asList(subTableStr.split(CgformUtil.f233E)));
            LambdaQueryWrapper<OnlCgformHead> lambdaQueryWrapper2 = new LambdaQueryWrapper();
            lambdaQueryWrapper2.in(OnlCgformHead::getTableName, arrayList);
            List<OnlCgformHead> list = super.list(lambdaQueryWrapper2);
            JSONObject jSONObject2 = new JSONObject();
            JSONObject jSONObject3 = new JSONObject();
            for (OnlCgformHead onlCgformHead2 : list) {
                JSONArray jSONArray = parseObject.getJSONArray(onlCgformHead2.getTableName());
                if (jSONArray != null && jSONArray.size() > 0) {
                    if (0 == onlCgformHead2.getRelationType().intValue()) {
                        jSONObject2.put(onlCgformHead2.getTableName(), jSONArray);
                    } else {
                        jSONObject3.put(onlCgformHead2.getTableName(), jSONArray.getJSONObject(0));
                    }
                }
                parseObject.remove(onlCgformHead2.getTableName());
            }
            jSONObject.put("one2one", jSONObject3);
            jSONObject.put("one2many", jSONObject2);
        }
        jSONObject.put(CgReportConstant.f469a, parseObject);
        return jSONObject;
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public OnlCgformHead copyOnlineTable(String id, String tableName) {
    	LambdaQueryWrapper<OnlCgformHead> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformHead::getTableName, tableName);
        Long selectCount = ((OnlCgformHeadMapper) this.baseMapper).selectCount(lambdaQueryWrapper);
        if (selectCount != null && selectCount.longValue() >= 1) {
            throw new TuringBootException("表名已经存在!");
        }
        OnlCgformHead onlCgformHead = (OnlCgformHead) ((OnlCgformHeadMapper) this.baseMapper).selectById(id);
        if (onlCgformHead == null) {
            throw new TuringBootException("表不存在!");
        }
        OnlCgformHead onlCgformHead2 = new OnlCgformHead();
        BeanUtils.copyProperties(onlCgformHead, onlCgformHead2);
        String m385a = CgformUtil.m385a();
        onlCgformHead2.setId(m385a);
        onlCgformHead2.setSubTableStr(null);
        onlCgformHead2.setTableName(tableName);
        onlCgformHead2.setTableVersion(1);
        onlCgformHead2.setIsDbSynch("N");
        onlCgformHead2.setCreateBy(null);
        onlCgformHead2.setCreateTime(null);
        onlCgformHead2.setUpdateBy(null);
        onlCgformHead2.setUpdateTime(null);
        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper2 = new LambdaQueryWrapper();
        lambdaQueryWrapper2.eq(OnlCgformField::getCgformHeadId, id);
        List<OnlCgformField> list = this.fieldService.list(lambdaQueryWrapper2);
        ArrayList arrayList = new ArrayList();
        if (list != null && list.size() > 0) {
            for (OnlCgformField onlCgformField : list) {
                OnlCgformField onlCgformField2 = new OnlCgformField();
                BeanUtils.copyProperties(onlCgformField, onlCgformField2);
                onlCgformField2.setCgformHeadId(m385a);
                onlCgformField2.setMainField(null);
                onlCgformField2.setMainTable(null);
                onlCgformField2.setId(null);
                onlCgformField2.setCreateBy(null);
                onlCgformField2.setCreateTime(null);
                onlCgformField2.setUpdateBy(null);
                onlCgformField2.setUpdateTime(null);
                arrayList.add(onlCgformField2);
            }
        }
        LambdaQueryWrapper<OnlCgformIndex> lambdaQueryWrapper3 = new LambdaQueryWrapper();
        lambdaQueryWrapper3.eq(OnlCgformIndex::getCgformHeadId, id);
        List<OnlCgformIndex> list2 = this.indexService.list(lambdaQueryWrapper3);
        ArrayList arrayList2 = new ArrayList();
        if (list2 != null && list2.size() > 0) {
            for (OnlCgformIndex onlCgformIndex : list2) {
                OnlCgformIndex onlCgformIndex2 = new OnlCgformIndex();
                BeanUtils.copyProperties(onlCgformIndex, onlCgformIndex2);
                onlCgformIndex2.setCgformHeadId(m385a);
                onlCgformIndex2.setId(null);
                onlCgformIndex2.setCreateBy(null);
                onlCgformIndex2.setCreateTime(null);
                onlCgformIndex2.setUpdateBy(null);
                onlCgformIndex2.setUpdateTime(null);
                arrayList2.add(onlCgformIndex2);
            }
        }
        save(onlCgformHead2);
        this.fieldService.saveBatch(arrayList);
        this.indexService.saveBatch(arrayList2);
        return onlCgformHead2;
    }

    @Override // org.jeecg.modules.online.cgform.service.IOnlCgformHeadService
    public OnlCgformHead getTable(String code) throws DBException {
        OnlCgformHead onlCgformHead = (OnlCgformHead) getById(code);
        if (onlCgformHead == null) {
            onlCgformHead = this.baseMapper.selectOne(new LambdaQueryWrapper<OnlCgformHead>().eq(OnlCgformHead::getTableName, code));
        }
        if (onlCgformHead == null) {
            throw new DBException("online表[" + code + "]不存在");
        }
        return onlCgformHead;
    }

    private DataBaseConfig getOnlineDataBaseConfig() {
        if (oConvertUtils.isEmpty(this.onlineDatasource)) {
            return this.dataBaseConfig;
        }
        DataSourceProperty dataSourceProperty = CommonUtils.getDataSourceProperty(this.onlineDatasource);
        if (dataSourceProperty == null) {
            f456a.error("jeecg.online.datasource配置错误,获取不到数据源返回master");
            return this.dataBaseConfig;
        }
        DataBaseConfig dataBaseConfig = new DataBaseConfig();
        dataBaseConfig.setDriverClassName(dataSourceProperty.getDriverClassName());
        dataBaseConfig.setPassword(dataSourceProperty.getPassword());
        dataBaseConfig.setUsername(dataSourceProperty.getUsername());
        dataBaseConfig.setUrl(dataSourceProperty.getUrl());
        dataBaseConfig.setDmDataBaseConfig(new DmDataBaseConfig());
        return dataBaseConfig;
    }
}
